Results 1 to 5 of 5

Thread: Strange Behaviour with Popup information Box

  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Strange Behaviour with Popup information Box

    1) Script Title: Popup information box II

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/popinfo2.htm

    3) Describe problem:

    I've run into a little error with this code, and I'm hoping someone knows what the problem is. The code works fine in Firefox, however when I run it on my page in internet explorer, the popup information box does not show up in the correct position (directly under the mouse) after one has scrolled down the page. The further the user scrolls down the page, the farther off the info box becomes.

    You can see it in action here:
    http://www.photomosaicproject.com/photographs.php
    (Note: If you do not have to scroll, type in 1, or 2 in the change column number box)

    Someone on this site told me to change the example code a little so that it would be compatible with firefox, and the change I made worked. . .so I don't know if that is the change that is causing this problem or not, but here is my updated code from the example. (I only changed the get_mouse function)

    Code:
    function get_mouse(e){
    var x = (ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
    skn.left= x + Xoffset +"px";
    var y = (ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
    skn.top= y + Yoffset + "px";
    }
    Maybe it is that code that is giving the problem in IE now. (Maybe I have to do an if/else statement, and check for what browser the user is using. . .I don't really know though.)

    Any ideas out there?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

  3. #3
    Join Date
    Jun 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I used the second one, and it works like a charm! Thanks for the heads up!

  4. #4
    Join Date
    Dec 2004
    Posts
    177
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default

    Yeah, I helped you get it going for Firefox...The reason it got screwy for IE...Microsoft is retarded. As of IE6, document.body is replaced by document.documentElement. The script Nile recommended has this check built in. Glad you got it working.
    Verzeihung!

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Yes, that was an old version. Always check to see if there are new versions of the script.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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