problems with non ie browsers

Discussion in 'Javascript' started by Ross, Sep 28, 2005.

  1. Ross

    Ross Guest

    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



    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Ross, Sep 28, 2005
    #1
    1. Advertising

  2. Ross

    RobG Guest

    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").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>



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



    --
    Rob
     
    RobG, Sep 28, 2005
    #2
    1. Advertising

  3. 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
     
    Gérard Talbot, Sep 28, 2005
    #3
  4. 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").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>
    >


    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
    --
    remove blah to email me
     
    Gérard Talbot, Sep 29, 2005
    #4
  5. Ross

    RobG Guest

    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/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



    --
    Rob
     
    RobG, Sep 29, 2005
    #5
  6. 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/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



    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
    --
    remove blah to email me
     
    Gérard Talbot, Sep 29, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    4
    Views:
    469
    Steven Campbell
    Aug 20, 2003
  2. William LaMartin

    ASP.NET and non-IE browsers

    William LaMartin, Dec 13, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    459
    William LaMartin
    Dec 14, 2003
  3. Mike Casey
    Replies:
    7
    Views:
    3,964
    Scott M.
    Dec 19, 2003
  4. Arnold Franke
    Replies:
    2
    Views:
    322
    Arnold Franke
    Feb 10, 2004
  5. El Kabong

    Browsers, browsers! Quo vadis?

    El Kabong, May 11, 2007, in forum: HTML
    Replies:
    23
    Views:
    933
    dorayme
    May 13, 2007
Loading...

Share This Page