Results 1 to 7 of 7

Thread: Another day, another problem! FF Column height and YT Video

  1. #1
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Another day, another problem! FF Column height and YT Video

    Hi all,

    Another problem.
    This time it's with my column heights. I'm using some mootools code to make my main and right divs the same height.
    This has worked fine right up until I embedded a video into an article.
    The column is only growing as big as the right div content or the text in the main div. Whichever is longer.
    Example here http://www.tsnet.co.uk/connect/typol...php/video.html

    This is the code I'm using to make my divs the same height. (Not my code but a google search)
    Code:
    function equalHeights() {
    var height = 0;
    divs = $$('#main','#right');
    divs.each( function(e){
     if (e.offsetHeight > height){
      height = e.offsetHeight;
     }
    });
     
    divs.each( function(e){
     e.setStyle( 'height', height + 'px' );
     if (e.offsetHeight > height) {
      e.setStyle( 'height', (height - (e.offsetHeight - height)) + 'px' );
     }
    }); 
    }
    and then calling the function at the end of my window.domready

    (I'm open to hear of other methods to do this too)

    Is this happening because the video is loading after the domready event?
    Any ideas for a fix?

    Thanks again!

  2. #2
    User
    Join Date
    06-19-09.
    Location
    Elbl?g, Poland
    Posts
    152

    Default Re: Another day, another problem! FF Column height and YT Vi

    In your source code:
    Code:
    <div id="main" style="height: 127px;">
    and that's the problem. Remove this inline css style (height).
    Marcin

    http://www.contao.pl - Polish Support Site
    http://forum.contao.pl - Polish Contao community forum


    -----------------------
    Need custom template? Feel free to contact me by e-mail marcin@contao.pl

  3. #3
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Another day, another problem! FF Column height and YT Vi

    Hi

    I think this style is put in place by the mootools code that gives me equal height column so is generated on domready.
    If you look in IE then this problem doesn't exist, only in Firefox. It's usually IE giving me issues!!

  4. #4
    User
    Join Date
    06-19-09.
    Location
    Elbl?g, Poland
    Posts
    152

    Default Re: Another day, another problem! FF Column height and YT Vi

    Yes, you're right. It's only happen in Firefox. I don't know why. In IE, Opera, Chrome and Safari works fine.
    Marcin

    http://www.contao.pl - Polish Support Site
    http://forum.contao.pl - Polish Contao community forum


    -----------------------
    Need custom template? Feel free to contact me by e-mail marcin@contao.pl

  5. #5
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Another day, another problem! FF Column height and YT Vi

    My suspicions were right and the youtube video is loading after the domready.
    Although not the most elegant solution, I put a 200ms delay on the equalheight function and this works ok.
    I will see how this works with several videos on one page

    I tried 3 videos and got the same issue so had to make it 500ms Not good

    Edit - I changed the domready for load and I don't need to use a delay but it's not pretty seeing the sidebar jump in growth with the equalheight function kicks in.

  6. #6
    User
    Join Date
    06-27-09.
    Location
    Ljusne, Sweden
    Posts
    59

    Default Re: Another day, another problem! FF Column height and YT Vi

    Pherhaps it would be easier and more "compatible" using a background pattern (for the div #container) that spans both columns? That eliminates the need for JavaScript and is 100% cross-browser.

  7. #7
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Another day, another problem! FF Column height and YT Vi

    Quote Originally Posted by SuperMatz
    Pherhaps it would be easier and more "compatible" using a background pattern (for the div #container) that spans both columns? That eliminates the need for JavaScript and is 100% cross-browser.
    Actually thinking about it, I can just apply my border and background colour to the container. Before I had a border-left of the #right div but now we aren't so I can remove the styling from #main and #right and just have it on #container.
    Thanks for the idea

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •