problems with non ie browsers

R

Ross

Hi,

I have a problem with non ie browsers

<script type="text/javascript">
window.onload = function(){
var strCook = document.cookie;
if(strCook.indexOf("!~")!=0){
var intS = strCook.indexOf("!~");
var intE = strCook.indexOf("~!");
var strPos = strCook.substring(intS+2,intE);
document.getElementById("menu_holder_inside").scrollTop = strPos;
}
}
function SetDivPosition(){
var intY = document.getElementById("menu_holder_inside").scrollTop;
// document.title = intY;
document.cookie = "yPos=!~" + intY + "~!";
}


The follwing function shou;d return a DIV to its positon before
 
R

RobG

Ross said:
Hi,

I have a problem with non ie browsers

<script type="text/javascript">
window.onload = function(){
var strCook = document.cookie;
if(strCook.indexOf("!~")!=0){
var intS = strCook.indexOf("!~");
var intE = strCook.indexOf("~!");
var strPos = strCook.substring(intS+2,intE);
document.getElementById("menu_holder_inside").scrollTop = strPos;
}
}
function SetDivPosition(){
var intY = document.getElementById("menu_holder_inside").scrollTop;
// document.title = intY;
document.cookie = "yPos=!~" + intY + "~!";
}


The follwing function shou;d return a DIV to its positon before

Your problem is with scrollTop. One of three separate routines need to
be used to get it correctly. IE will behave differently in quirksmode
to strict mode, other browsers differently again. The following should
help:

<URL:http://www.quirksmode.org/viewport/compatibility.html>
 
G

Gérard Talbot

Danny a écrit :
Make it instead of .scrollTop, .pageYOffset for mozilla, same property.


Danny

Rubbish. pageYOffset is for the window object only.

Gérard
 
G

Gérard Talbot

RobG a écrit :
Your problem is with scrollTop. One of three separate routines need to
be used to get it correctly. IE will behave differently in quirksmode
to strict mode, other browsers differently again. The following should
help:

<URL:http://www.quirksmode.org/viewport/compatibility.html>

That reference is regarding the browser window viewport scrolling, not
an element which is clearly the case here. The OP says and wants to
store the inside scroll position/view of an element id-ed as
"menu_holder_inside". Nowhere do I see any reference to the inner
browser window viewport.

http://www.gtalbot.org/BugzillaSection/DocumentAllDHTMLproperties.html

http://www.mozilla.org/docs/dom/domref/scrollTop.html#Example

http://developer.mozilla.org/en/docs/DOM:element.scrollTop#scrollTop

Gérard
 
R

RobG

Gérard Talbot said:
RobG a écrit :
[...]
Your problem is with scrollTop. One of three separate routines need
to be used to get it correctly. IE will behave differently in
quirksmode to strict mode, other browsers differently again. The
following should help:

<URL:http://www.quirksmode.org/viewport/compatibility.html>

That reference is regarding the browser window viewport scrolling, not
an element which is clearly the case here.

Not so clear to me, though it did occur to me later that maybe that's
what the OP was after. But cold beer beckoned... :p
The OP says and wants to
store the inside scroll position/view of an element id-ed as
"menu_holder_inside". Nowhere do I see any reference to the inner
browser window viewport.

http://www.gtalbot.org/BugzillaSection/DocumentAllDHTMLproperties.html

http://www.mozilla.org/docs/dom/domref/scrollTop.html#Example

http://developer.mozilla.org/en/docs/DOM:element.scrollTop#scrollTop

Thanks, that's gotta be the best documented undocumented feature I've
ever come across! :-x
 
G

Gérard Talbot

RobG a écrit :
Gérard Talbot said:
RobG a écrit :
[...]
Your problem is with scrollTop. One of three separate routines need
to be used to get it correctly. IE will behave differently in
quirksmode to strict mode, other browsers differently again. The
following should help:

<URL:http://www.quirksmode.org/viewport/compatibility.html>

That reference is regarding the browser window viewport scrolling, not
an element which is clearly the case here.


Not so clear to me, though it did occur to me later that maybe that's
what the OP was after. But cold beer beckoned... :p

Ok. :)

Thanks, that's gotta be the best documented undocumented feature


There was a filed bug. I took assignment and re-did or updated all the
pages referring to these properties.


I've
ever come across! :-x

Well, that image
http://msdn.microsoft.com/workshop/graphics/dhtmlpos.gif
and that page
http://msdn.microsoft.com/workshop/author/om/measuring.asp
were already available. scrollTop is ok for all elements which can
render scrollbars.

Gérard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top