Skip to content

Instantly share code, notes, and snippets.

@seebz
Created November 21, 2012 08:48
Show Gist options
  • Save seebz/4123863 to your computer and use it in GitHub Desktop.
Save seebz/4123863 to your computer and use it in GitHub Desktop.
Shadowbox IE8 fix
// Shadowbox
jQuery(function($){
if (typeof Shadowbox == 'undefined') return;
// Correction du bug avec IE8
var originalGetStyle = Shadowbox.lib.getStyle;
Shadowbox.lib.getStyle = function(el, style) {
var value = originalGetStyle.apply(Shadowbox.lib, arguments);
if ($.inArray(value, ['thin', 'medium', 'thick']) && style.match(/^border(-(top|right|bottom|left))?-width$/))
{
switch(value)
{
case 'thin': value = '6px'; break;
case 'medium': value = '4px'; break;
case 'thick': value = '2px'; break;
}
}
return value;
}
Shadowbox.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment