Reputation: 6079
I'm using FancyBox, and I want to make a gallery without thumbnails on the page.
I have a set of images:
http://blabla/image1.jpg
http://blabla/image2.jpg
http://blabla/image3.jpg
And i have a span element:
<span style="text-decoration: underline">click to view gallery</span>
I don't need any thumbnails on the page, I just want them to display as a FancyBox gallery when user clicks on the span. I need some sort of javascript FancyBox initiation code, I googled, but it seems there is no functionality for that (???).
What's the best way of doin' that? thanks!
Upvotes: 3
Views: 2307
Reputation: 39704
attach click event to that span
<span id="myspan" style="text-decoration: underline; cursor:pointer;">click to view gallery</span>
<script>
$("#myspan").click(function() {
$.fancybox([
'http://blabla/image1.jpg',
'http://blabla/image2.jpg',
'http://blabla/image3.jpg'
], {
'padding' : 0,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'image',
'changeFade' : 0
});
});
</script>
Upvotes: 6