I'm just wondering if you can help. I am trying to get fancybox to load automatically after the page is rendered. However, I received this error message 't is undefined' on line 18 (/ js / fancybox / jquery.fancybox-1.3.3.pack.js). I'm currently using jquery version 1.4.2
<a href="#container" id="profile">Click me</a>
<div style="display:none">
<div id="container">Fancybox Content Here .... </div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#profile').fancybox().trigger('click');
});
</script>
The funny thing is, if I take the line below and run it in the firebug console, then it WORKS !. Not sure what I did wrong here. Your help would be greatly appreciated.
$('#profile').fancybox().trigger('click');
thank
source
share