jQuery Plugin Supersized: Click outside thumbnail-wrapper in order to close it

258 views Asked by At

I'm using WP Supersized (http://buildinternet.com/project/supersized/slideshow/3.2/demo.html / http://wordpress.org/plugins/wp-supersized/) and I want to modify it: There is a tray button, which opens / closes a div containing thumbnails. So far so good but I need an additional feature: If the user clicks out of this div it should disappear resp. move to the bottom.

This is the relevant code:

a(vars.thumb_tray).animate({
            bottom: -a(vars.thumb_tray).height()
        }, 0);
        a(vars.tray_button).toggle(function () {
            a(vars.thumb_tray).stop().animate({
                bottom: 0,
                avoidTransforms: true
            }, 300);
            if (a(vars.tray_arrow).attr("src")) a(vars.tray_arrow).attr("src", vars.image_path + "button-tray-down.png");
            return false
        }, function () {
            a(vars.thumb_tray).stop().animate({
                bottom: -a(vars.thumb_tray).height(),
                avoidTransforms: true
            }, 300);
            if (a(vars.tray_arrow).attr("src")) a(vars.tray_arrow).attr("src", vars.image_path + "button-tray-up.png");
            return false
        });

I'm a javascript beginner so any help would be great. :)

0

There are 0 answers