Hide/Show script is loading hidden content

Discussion in 'JavaScript' started by mark_s, May 22, 2008.

  1. #1
    In Firefox the YouTube videos don't load until you click the expandable link but in Internet Explorer, everything hidden loads first which means the page lags.

    http://www.murraysworld.com/video/

    Please can someone make it so IE stops doing this?

    <!--
    function dsp(loc){
       if(document.getElementById){
          var foc=loc.firstChild;
    
             foc=loc.firstChild.innerHTML?
             loc.firstChild:
             loc.firstChild.nextSibling;
    
             var th = document.getElementById(loc);
             if(th != null){
               //th.innerHTML=th.innerHTML=='+'?'-':'+';
                foc.innerHTML=foc.innerHTML=='+'?'-':'+';
             }
    
             foc=loc.parentNode.nextSibling.style?
             loc.parentNode.nextSibling:
             loc.parentNode.nextSibling.nextSibling;
          foc.style.display=foc.style.display=='block'?'none':'block';}}
    
    if(!document.getElementById)
       document.write('<style type="text/css"><!--\n'+
          '.more_content{display:block;}\n'+
          '//--></style>');
    //-->
    Code (markup):

     
    mark_s, May 22, 2008 IP