Bug Tracker

Modify

Ticket #7496 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

Set Offset doesn't work correctly if page is scrolled

Reported by: dan@… Owned by: dan@…
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

Elements positioned with offset appear to be positioned to the viewport instead of to the document. So $(element).offset({left: 100, top: 100}) would position the element at top: 200 if the page was scrolled by 100 pixels.

Change History

comment:1 Changed 3 years ago by boushley

  • Owner set to dan@…
  • Status changed from new to pending

Thanks for contributing to the jQuery project. I've created a jsFiddle for the use case you're describing but can't reproduce the problem.  http://jsfiddle.net/boushley/hMCDb/1/ I'm testing this on Google Chrome on a Mac, if you could provide a reproducible test case that would be great.

comment:2 Changed 3 years ago by anonymous

Scratch that...I did some more testing and it's not that simple. It is doing what I reported, but I'm not sure how to reproduce it...

comment:3 Changed 3 years ago by dmethvin

  • Status changed from pending to closed
  • Resolution set to worksforme

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.