Bug Tracker

Modify

Ticket #2681 (closed bug: duplicate)

Opened 5 years ago

Last modified 15 months ago

offsetLeft and offsetTop off by 2 pixels in MSIE7

Reported by: iconico Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.3
Keywords: position Cc:
Blocking: Blocked by:

Description

If I get the offsetLeft and offsetTop in IE7 they start at 2pixels, in Firefox they correctly start at 0 pixels:

<script> jQuery(document).ready(function(){

$("#special").mousemove(function(e){

var x = e.pageX - this.offsetLeft; var y = e.pageY - this.offsetTop;

$('#status2').html(x +', '+ y);

});

}) </script>

<h2 id="status2"> 0, 0 </h2> <div style="margin-left:100px; width: 100px; height: 100px; background:#ccc;" id="special"> Click me anywhere! </div>

Change History

comment:1 Changed 5 years ago by brandon

  • Status changed from new to closed
  • Resolution set to duplicate

Duplicate of #2247

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.