This jQuery plugin lets you create fullscreen galleries where the slides are shown on the entire screen using the fullscreen APIs provided by Firefox 10+ and Chrome 15+ (and possibly Safari 5.1+).
In all other browsers it falls back to displaying the slideshow in the entire viewport.
Example (click image to view)
Pictures take from Wikimedia Commons Picture of the Year 2007.
Usage
$(function(){ // initialize the slideshow $('.image img').fullscreenslides(); // All events are bound to this container element var $container = $('#fullscreenSlideshowContainer'); $container //This is triggered once: .bind("init", function() { // The slideshow does not provide its own UI, so add your own // check the fullscreenstyle.css for corresponding styles $container .append('<div class="ui" id="fs-close">×</div>') .append('<div class="ui" id="fs-loader">Loading...</div>') .append('<div class="ui" id="fs-prev"><</div>') .append('<div class="ui" id="fs-next">></div>') .append('<div class="ui" id="fs-caption"><span></span></div>'); // Bind to the ui elements and trigger slideshow events $('#fs-prev').click(function(){ // You can trigger the transition to the previous slide $container.trigger("prevSlide"); }); $('#fs-next').click(function(){ // You can trigger the transition to the next slide $container.trigger("nextSlide"); }); $('#fs-close').click(function(){ // You can close the slide show like this: $container.trigger("close"); }); }) // When a slide starts to load this is called .bind("startLoading", function() { // show spinner $('#fs-loader').show(); }) // When a slide stops to load this is called: .bind("stopLoading", function() { // hide spinner $('#fs-loader').hide(); }) // When a slide is shown this is called. // The "loading" events are triggered only once per slide. // The "start" and "end" events are called every time. // Notice the "slide" argument: .bind("startOfSlide", function(event, slide) { // set and show caption $('#fs-caption span').text(slide.title); $('#fs-caption').show(); }) // before a slide is hidden this is called: .bind("endOfSlide", function(event, slide) { $('#fs-caption').hide(); }); });
License
© Copyright 2012 by Eike Send
Nhận xét
Đăng nhận xét