SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Absolute positioning <div>'s in firefox?

    The following works in IE, but not in firefox:

    Code:
    document.getElementById('mydiv').style.left = event.clientX + document.body.scrollLeft;
    document.getElementById('mydiv').style.top = event.clientY + document.body.scrollTop;
    Any ideas why?

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firefox handles events differently from IE. Firefox follows the DOM2 Events module specs. IE/Win has its own event system.

    Check these out:
    http://www.quirksmode.org/js/contents.html#events
    http://www.brainjar.com/dhtml/events/
    http://www.oreillynet.com/pub/a/java...ls.html?page=1
    http://developer.apple.com/internet/...entmodels.html
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •