Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > problems with non ie browsers

Reply
Thread Tools

problems with non ie browsers

 
 
Ross
Guest
Posts: n/a
 
      09-27-2005
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
 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      09-27-2005
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
 
Reply With Quote
 
 
 
 
Gérard Talbot
Guest
Posts: n/a
 
      09-28-2005
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
 
Reply With Quote
 
Gérard Talbot
Guest
Posts: n/a
 
      09-29-2005
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
 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      09-29-2005
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!



--
Rob
 
Reply With Quote
 
Gérard Talbot
Guest
Posts: n/a
 
      09-29-2005
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!
>


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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
With non-risk and non-misgiving to gain cheap obscene DVD video or clips! (Non-Mask, Only cost 6 $ / per disc) huglig Computer Support 0 10-09-2007 01:42 AM
With non-risk and non-misgiving to gain cheap obscene DVD video or clips! (Non-Mask, Only cost 6 $ / per disc) huglig DVD Video 2 10-06-2007 02:30 PM
Browsers, browsers! Quo vadis? El Kabong HTML 23 05-13-2007 08:55 PM
Two Browsers work! Two browsers won't load. Internet game service won't load jimmie Computer Support 1 02-26-2006 08:36 AM
Appearance of Web Form controls in non-IE browsers Alex ASP .Net 4 08-20-2003 08:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57