Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Location
    Nigeria
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scrollTop not working on IE

    Im using javscript to show a simple pop up where a user clicks on a page.
    the code looks something like this:
    Code:
    var ie=document.all;
    var nn6=document.getElementById&&!document.all;
    
    function showBx(e){
    	bx = document.getElementById('tipbox').style;
    	bx.visibility='visible';
    	ty = document.body.scrollTop;
        bx.left = nn6 ? e.clientX : event.clientX;
    	bx.top  = nn6 ? ty + e.clientY : ty + event.clientY;
        return false;
    }
    I however find out that document.body.scrollTop doesnt work on IE (works on Opera). Any suggestions/recommendations?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    What version of IE

    You could try

    document.documentElement.scrollTop
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •