Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$(window).load(function() {
var $body = $('body');
// fix Safari letter-spacing bug when styles applied in `head`
// Trigger styles redraw by changing body display property to differentvalue and reverting it back to original.
if ($body.hasClass('safari')){
var original_display_value = $body.css('display');
var different_display_value = 'initial' === original_display_value ? 'block' : 'initial';
$body.css({ 'display': different_display_value });
setTimeout(function() {
$body.css({ 'display': original_display_value });
}, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment