Clicking on slideshow takes to next image

This commit is contained in:
ville rantanen
2012-11-01 12:32:20 +02:00
parent c29a2e389a
commit c39092854c

View File

@@ -946,9 +946,7 @@ function setup() {
}
document.onkeydown=keypressed;
slideshowinterval=request('auto');
if (slideshowinterval!=0) {
slideshowtimer=setInterval('slidenext()',1000*Math.abs(slideshowinterval));
}
if (slideshowinterval!=0) { slidenextrestart(); }
fullscreen=request('full')==1;
originals=request('orig')==1;
request('sort');
@@ -984,13 +982,17 @@ function showbigimage(i) {
if (fullscreen) { height=height+200; }
if (originals) { mediumstr=encodeURIComponent(imagelist[i]); }
else { mediumstr='_med/med_'+encodeURIComponent(imagelist[i])+'.jpg'; }
var linkToBig = '<a class="linktobig" href="'+encodeURIComponent(imagelist[i])+'" target="_blank">';
if (slideshowinterval!=0) {
linkToBig = '<a class="linktobig" onclick="slidenextrestart()">';
}
if (isHTML(imagelist[i])) {
$('#imagecontainer').html('<div id="imagebig"><a class="linktobig" href="'+encodeURIComponent(imagelist[i])+'" target="_blank">'+
$('#imagecontainer').html('<div id="imagebig">'+linkToBig+
'<iframe id="imagesingle" src="'+encodeURIComponent(imagelist[i])+'"></a></div>');
$('#imagesingle').css('width',width);
$('#imagesingle').css('height',height);
} else { // is image
$('#imagecontainer').html('<div id="imagebig"><a class="linktobig" href="'+encodeURIComponent(imagelist[i])+'" target="_blank">'+
$('#imagecontainer').html('<div id="imagebig">'+linkToBig+
'<img id="imagesingle" src="'+mediumstr+'"></a></div>');
$('#imagesingle').css('max-width',width);
$('#imagesingle').css('max-height',height);
@@ -1499,7 +1501,6 @@ function hidethumbs() {
}
return;
}
function slidenext() {
var imgs=$('#preloadcontainer img').length;
var completed=preloadcheckcount();
@@ -1514,6 +1515,12 @@ function slidenext() {
showimage(currentimage);
}
}
function slidenextrestart() {
if (slideshowinterval==0) { showimage(currentimage); return; }
if (slideshowtimer) { clearInterval(slideshowtimer); }
slideshowtimer=setInterval('slidenext()',1000*Math.abs(slideshowinterval));
slidenext();
}
function slidesetupfromconfig() {
var el=$('#configSlideInterval')[0];
var newinterval=parseInt(el.value);