678 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $250,000+ on Envato Market
  • Has referred 500+ members
+11 more
cudazi Envato team says

I have an odd issue I’ve tracked down to the way chrome 12.0.7 is returning the offset().top value.

I’ve simplified the code down to this sample for testing: (Any time a link is clicked, it should just log the position of an item with the ID of portfolio no matter where you are on the page.)

$('a').click(function() {
    console.log( $('#portfolio').offset().top );    
});

Firefox and Safari work fine, but with Chrome (12.0.7 mac) the value changes depending on where you’re scrolled to along the page like it’s returning scrollTop().

Thanks for any ideas. :)

678 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $250,000+ on Envato Market
  • Has referred 500+ members
+11 more
cudazi Envato team says

...like it’s returning scrollTop().

Like it’s returning $(window).scrollTop() I meant to say.

2187 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+10 more
revaxarts says

Is the parent element set to position:relative ?

678 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $250,000+ on Envato Market
  • Has referred 500+ members
+11 more
cudazi Envato team says

No luck on my local example but I think you may be on the right track.

678 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $250,000+ on Envato Market
  • Has referred 500+ members
+11 more
cudazi Envato team says

It seems the target item needs to be explicitly set position: relative for the latest version of Chrome.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by