Hi i’m using the following jquery UI Lightbox this code is not working in IE
refered from http://www.class.pm/files/jquery/jquery.ulightbox/demo/
<script type="text/javascript" src="js/jquery.ulightbox.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.ulightbox.css" />
<script type="text/javascript">
$(document).ready(function() {
uLightBox.init({
override:true,
background: 'white',
centerOnResize: true,
fade: true
});
$('#alert').click(function() {
alert('Hello');
});
});
</script>
is there any option to work out this in IE?
You’re right: the “uLightBox” plugin (or “ClassyLightbox”, as it’s currently named) doesn’t work with Internet Explorer (at least with versions 8 and 9), since it throws a JavaScript error.
However, I’ve managed to make it work this way:
In my example I’ve used the latest version of the plugin, downloaded from here.
Then I’ve set
overrideto false and redefined thealert()function to invoke theClassyLightbox.alertmethod.If you’re using an older version of the plugin, you should do it this way:
The drawback of this solution is that you can no longer change the background color; in other words when
overrideis set to false, thebackgroundproperty is ignored.