-
-
Save malsup/1855806 to your computer and use it in GitHub Desktop.
Fix Chrome background refresh bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// might as well make it a plugin | |
$.fn.fixChromeBg = function() { | |
if (! /chrome/i.test(navigator.userAgent) ) | |
return this; | |
return this.each(function() { | |
var el = $(this), bi = el.css( 'background-image' ); | |
if (bi) { | |
setTimeout(function() { | |
el.css( 'background-image', bi); | |
}, 1); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$('.myElementsWithBackgrounds').fixChromeBg();