Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Netscape 6 stuff 1

Status
Not open for further replies.

Kaitana

Programmer
Apr 19, 2002
5
0
0
CA
I am sure it is in the FAQ's but I cannot find anything on this. I am probably seraching with the wrong keywords.

I need to call a <DIV> in the main frame from a NAv frame. The code basically makes the div visible onmouseover(for sub-menus). The code worked ok, until I tried to add y and x offset. here is the code I used.
<!--
function navHighlight(layer, num){
if (browser == 'ns'){
parent.top.main.document[layer].top = num * 40 + 5 + parent.top.main.pageYOffset;
parent.top.main.document[layer].left = parent.top.main.pageXOffset;
show(layer);
}else if (browser == 'ie'){
eval(&quot;parent.top.main.&quot;+layer+&quot;.style.top = num * 40 + 5 + parent.top.main.document.body.scrollTop;&quot;);
eval(&quot;parent.top.main.&quot;+layer+&quot;.style.left = parent.top.main.document.body.scrollLeft;&quot;);
show(layer);
}else if (browser == 'ns6'){
eval(&quot;parent.top.main.document[&quot;+layer+&quot;].top = num * 40 + 5 + parent.top.main.document.body.scrollTop;&quot;);
eval(&quot;parent.top.main.document[&quot;+layer+&quot;].left = parent.top.main.document.body.scrollLeft;&quot;);

show(layer);
}

}
//-->

Brower == 'ns' and browser =='ie' both work fine.
If anyone is willing, I will send the framesets to you. This code has been bugging me now for a week, and I need to move on. Thank you very much in advance.
 
ok I am about to leave but maybe I can help you out a bit. At least tell you what you could look for.

netscape 4 accesses layers with the document.layers[id] Document Oject Model (DOM). Internet Explorer with document.all[id] and Netscape 6 with the standard compliant document.getElementById(id).

also document.body.scrollLeft is not a valid standard compliant property. Check this site for the standard compliant way of accessing the scroll position :


Have to go. :) hope this helps. Gary Haran
 
xutopia, you are being a wonderful help.
(parent.top.main.document.getElementById(layer).top) worked btw.

But this does not, and it is cut an paste from the site you posted.

function returnScroll(){
ypix = window.scrollY;
alert(ypix);
}

always returns 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top