I have a small site that takes advantage of a neat scrolling trick and jQuery's .addClass()
Basically, The site checks to see if you've scrolled past a certain point and then sets the class on an element, causing it to have extra transformations or animations.
In Chrome 23.x, There is no issue with the code;
But in Webkit based browsers on Mac, and Chrome 27.x+ (Lowest I've gotten reports of the bug) in other operating systems, The elements "Duplicate" when the class is removed.
The bug has never shown up in Firefox
Here is the Javascript
<script>
$(window).scroll(function () {
navi = $('#navi').height();
logo = $('#navi .logo img').height();
user = $('#user').height();
if ($(window).scrollTop() >= navi - logo) {
if (!$('#navi').hasClass("active")) {
$('#navi').addClass("active");
}
} else {
$('#navi').removeClass("active");
}
if ($(window).scrollTop() >= user) {
if (!$('#user').hasClass("active")) {
$('#user').addClass("active");
}
} else {
$('#user').removeClass("active");
}
});
</script>
I'm not 100% that the Javascript is at fault; It may be CSS in Webkit that is causing the issue, either way it is causing me grief.
Here is a Youtube Video of the expected results, and here is a Screenshot of the "Dupe" bug (I run Chrome 23.x in Linux so I had a friend take the screenshot)
The page can be found at dev.brokengear.net/gatesofender
Upon further digging, It appears to be an issue with certain browsers artifacting due to it's Tile-Based rendering system.