Created
November 21, 2012 08:48
-
-
Save seebz/4123863 to your computer and use it in GitHub Desktop.
Shadowbox IE8 fix
This file contains 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
// 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