Roman Pushkin
Roman Pushkin

Reputation: 6079

Fancybox gallery without thumbnails

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

Answers (1)

Mihai Iorga
Mihai Iorga

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

Related Questions