Here is my HTML code:
<a id="hidden_link" href="StatusNotification.aspx" class="statusNotification fancybox.iframe"></a>
And this is my jquery(fancybox) code
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$(".statusNotification").fancybox({
helpers: {
overlay: {
closeClick: false
},
// prevents closing when clicking OUTSIDE fancybox
title: {
type: 'float'
}
},
scrolling: 'no',
//prevents scrolling
width: 600
})
$('#hidden_link').fancybox().trigger('click');
});
</script>
I have called the above script on page load to show a fancy box, but it doesn’t show, giving the error:
Microsoft JScript runtime error: 'Array' is undefined** in IE 9
But it works fine in IE 7 and IE 8.
Does any one know a solution to this problem?
EDIT: This error occurs only if I try to trigger it using JavaScript. If I trigger it manually by clicking on the link, it works fine.
You first add a
fancybox()to$('.statusNotification')and then you add it to$('#hidden_link')which in this example is the same thing.Change the javascript to:
This works, try it here: http://jsfiddle.net/J9uEV/