nextcloud/apps/gallery/js/slideshow.js

59 lines
1.6 KiB
JavaScript
Raw Normal View History

2012-07-05 01:36:49 +04:00
$(document).ready(function(){
$.endSlideshow = function () {
if($.supersized.vars.slideshow_interval){
clearInterval($.supersized.vars.slideshow_interval);
};
2012-07-09 18:04:46 +04:00
$('#supersized-holder').remove();
2012-07-05 01:36:49 +04:00
$('#slideshow-content').hide();
$('#thumb-list').remove();
}
// add slideshow in holder div
$('#slideshow input.start').click(function(){
var images=[];
$('#gallerycontent div a').each(function(i,a){
images.push({image : a.href, title : a.title.replace(/</, '&lt;').replace(/>/, '&gt;'), thumb : a.children[0].src, url : 'javascript:$.endSlideshow()'});
2012-07-05 01:36:49 +04:00
});
if (images.length <= 0) {
return;
}
2012-07-09 18:04:46 +04:00
$('body').append("<div id='supersized-holder'></div>");
$('#supersized-loader').remove();
$('#supersized').remove();
$('#supersized-holder').append("<div id='supersized-loader'></div><ul id='supersized'></ul>");
$('#supersized').show();
2012-07-05 01:36:49 +04:00
$('#slideshow-content').show();
jQuery(function($){
$.supersized({
// Functionality
slide_interval : 3000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 700, // Speed of transition
// Components
slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
slides : images // Slideshow Images
});
});
});
//close slideshow on esc and remove holder
$(document).keyup(function(e) {
if (e.keyCode == 27) { // esc
$.endSlideshow();
}
});
});