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";
}
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";
}
Comment