By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

problems with non ie browsers

P: n/a
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").scro llTop = strPos;
}
}
function SetDivPosition(){
var intY = document.getElementById("menu_holder_inside").scro llTop;
// document.title = intY;
document.cookie = "yPos=!~" + intY + "~!";
}
The follwing function shou;d return a DIV to its positon before

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Sep 27 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Ross wrote:
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").scro llTop = strPos;
}
}
function SetDivPosition(){
var intY = document.getElementById("menu_holder_inside").scro llTop;
// 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>


--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

--
Rob
Sep 27 '05 #2

P: n/a


Make it instead of .scrollTop, .pageYOffset for mozilla, same property.
Danny
Sep 28 '05 #3

P: n/a
Danny a écrit :

Make it instead of .scrollTop, .pageYOffset for mozilla, same property.
Danny


Rubbish. pageYOffset is for the window object only.

Gérard
--
remove blah to email me
Sep 28 '05 #4

P: n/a
RobG a écrit :
Ross wrote:
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").scro llTop =
strPos;
}
}
function SetDivPosition(){
var intY =
document.getElementById("menu_holder_inside").scro llTop;
// 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>


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/BugzillaSecti...roperties.html

http://www.mozilla.org/docs/dom/domr...p.html#Example

http://developer.mozilla.org/en/docs...lTop#scrollTop

Gérard
--
remove blah to email me
Sep 29 '05 #5

P: n/a
Gérard Talbot wrote:
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/BugzillaSecti...roperties.html

http://www.mozilla.org/docs/dom/domr...p.html#Example

http://developer.mozilla.org/en/docs...lTop#scrollTop


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

--
Rob
Sep 29 '05 #6

P: n/a
RobG a écrit :
Gérard Talbot wrote:
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. :)

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/BugzillaSecti...roperties.html

http://www.mozilla.org/docs/dom/domr...p.html#Example

http://developer.mozilla.org/en/docs...lTop#scrollTop

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/g...s/dhtmlpos.gif
and that page
http://msdn.microsoft.com/workshop/a.../measuring.asp
were already available. scrollTop is ok for all elements which can
render scrollbars.

Gérard
--
remove blah to email me
Sep 29 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.