Saturday, 7 September 2013

Fancybox trigger click

Fancybox trigger click

I'm trying to get fancybox to trigger if the hash is available in the url,
problem is the diffrent methods ive used some of them taken here from
stackoverflow returns "c not available" in the error console in firefox.
the site im trying this on can be found here http://rojava.se/om/#infor.
All help is greatly appreciated
methods ive tried: How to create a direct link to any fancybox box
<script type="text/javascript">
var thisHash = window.location.hash;
$(document).ready(function() {
if(window.location.hash) {
$(thisHash).fancybox({
padding: 0
// more API options
}).trigger('click');
}
$('.fancylink').fancybox({
padding: 0
// more API options
});
}); // ready
</script>
Second method: Fancybox doesn't trigger on $(elem).click(), but does on
"real" click?
jQuery('a[href="http://hallarna.se/wp-content/gallery/2013/spoksonatenloggaliten.jpg"]').trigger('mousedown').trigger('click');

No comments:

Post a Comment