Script crashing IE6.... please help!!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Newbie

    Script crashing IE6.... please help!!

    Please Help,

    I have 2 <div's> named "DETdetails " & "MEMOdetail s" in my ASP page that
    loads an external css file for these 2 <div's>

    I want both <div's> to be static when the page scrolls hence the js
    script...

    When i disable (comment out) one of the <div's> in the js script, the script
    works fine... however when i try both <div's> in the js script, it works
    only every other time and the rest of the time it completely crashes IE6.

    I could really do with someone's assitance with this.. the problem may stare
    me in the face but i cant for the life of me see it...

    Thanks,

    JS SCRIPT below
    ............... ............... ............... ............... ............... ..
    ............... ............... ..

    function Dets() {
    var detRef=document .getElementById ("DETdetails ");
    var dScroll=documen t.body.scrollTo p;
    var dOBJwidth=detRe f.offsetWidth; dOBJheight=detR ef.offsetHeight ;
    detRef.style.le ft=( (DOCwidth/2 - dOBJwidth/2) +99)+"px";
    detRef.style.to p=dScroll+( (DOCheight/2 - dOBJheight/2) +115)+"px";
    detRef.style.vi sibility="visib le";
    }

    function hideDetails() {
    var detRef=document .getElementById ("DETdetails ");
    detRef.style.vi sibility="hidde n";
    }

    function Memo() {
    memoRef=documen t.getElementByI d("MEMOdetails" );
    detRef=document .getElementById ("DETdetails ");

    var mScroll=documen t.body.scrollTo p;
    var mOBJwidth=memoR ef.offsetWidth; mOBJheight=memo Ref.offsetHeigh t;
    var dOBJwidth=detRe f.offsetWidth; dOBJheight=detR ef.offsetHeight ;

    memoRef.style.l eft=( (DOCwidth/2 - dOBJwidth/2) +99)+"px";
    memoRef.style.t op=mScroll+( (DOCheight/2 - dOBJheight/2) -35)+"px";
    setInterval("th eDivs()",50);
    }

    function theDivs() {
    var dScroll=documen t.body.scrollTo p;
    memoRef.style.t op=dScroll+( (DOCheight/2 - dOBJheight/2) -35)+"px";
    detRef.style.to p=dScroll+( (DOCheight/2 - mOBJheight/2) +115)+"px";
    }


  • RobG

    #2
    Re: Script crashing IE6.... please help!!

    Newbie wrote:

    [color=blue]
    > When i disable (comment out) one of the <div's> in the js script, the script
    > works fine... however when i try both <div's> in the js script, it works
    > only every other time and the rest of the time it completely crashes IE6.
    >[/color]

    That's not your only problem. offsetWidth, offsetHeight,
    scrollTop (and likely other some other methods you are
    trying to use) are unreliable across various browsers. There
    is a useful reference here:





    Cheers, Rob.

    Comment

    Working...