Ticket #3518 (closed bug: invalid)
Opera does not correctly animate(offsetTop)
| Reported by: | fil@… | Owned by: | brandon |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3 |
| Component: | offset | Version: | 1.2.6 |
| Keywords: | opera animate offsettop | Cc: | fil@…, flesler |
| Blocking: | Blocked by: |
Description
With this script the Opera brwoser goes first to the top (offsetTop 0) before aniamting to the correct location
Attachments
Change History
comment:1 Changed 5 years ago by flesler
- Cc fil@…, flesler added
- Status changed from new to closed
- Resolution set to invalid
comment:2 Changed 5 years ago by fil@…
The bug also appears when the DOCTYPE is set, see for example http://blog.mondediplo.net/2008-09-16-Freddie-Mac-Fannie-Mae-la-Chine-et-les
As for jQuery.ScrollTo I used it at first, with the same problem on Opera; that's why I went to a simpler code, in order to try and resolve this bug
comment:3 Changed 5 years ago by flesler
I don't see where to click in that example.
Using the body in your initial demo does make it work.
jQuery.ScrollTo is tested with both transitional and strict doctypes, on IE 6 & 7, FF 2 & 3, Safari 3 and Opera 9.2 & 9.5. All on windows.
comment:4 Changed 5 years ago by fil@…
OK but on (my) Opera Mac it first "jumps" to the top, then animates to the anchor. And the same problem happens with scrollTo
comment:5 Changed 5 years ago by flesler
As I told you, once you add a doctype and put it out of quirk mode, you need to use html instead of body.
I tried your example and does what you describe, then put html and all went well. Tried last version of scrollTo and worked all too.
comment:6 Changed 5 years ago by fil@…
OK version 1.4 of jquery.localscroll fixes it! I was with 1.3, sorry for the trouble
comment:7 Changed 5 years ago by fil@…
I must add that http://dev.jquery.com/browser/trunk/plugins/scrollTo/jquery.scrollTo.js is still 1.3
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


You need to animate just the body in order to make it work. But... you're putting it into quirks mode. Add a correct doctype and try again, I think you'll need to use $('html') then to make it work properly.
Needless to say, you should use jQuery.ScrollTo for this. It should handle all different browsers (including versions) properly. That is, as long as you add a proper doctype.