Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions jquery.jshowoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ effect : transition effect [string: 'fade', 'slideLeft' or 'none', defaults to
hoverPause : whether to pause on hover [boolean, defaults to true]
links : whether to create & display numeric links to each slide [boolean, defaults to true]
speed : time each slide is shown [integer, milliseconds, defaults to 3000]

resumeFromPause : whether to resume from Pausing when clicking on a numeric link [boolean, defaults to true]
*/

(function($) {
Expand All @@ -41,7 +41,8 @@ speed : time each slide is shown [integer, milliseconds, defaults to 3000]
effect : 'fade',
hoverPause : true,
links : true,
speed : 3000
speed: 3000,
resumeFromPause: true
};

// merge default global variables with custom variables, modifying 'config'
Expand Down Expand Up @@ -159,8 +160,10 @@ speed : time each slide is shown [integer, milliseconds, defaults to 3000]
// start slide rotation on specified interval
function play(src) {
if(!isBusy()){
counter++;
transitionTo(gallery,counter);
if(src!='hover') {
counter++;
transitionTo(gallery,counter);
}
if(src=='hover' || !isPlaying()) {
timer = setInterval(function(){ play(); },config.speed);
}
Expand Down Expand Up @@ -201,6 +204,10 @@ speed : time each slide is shown [integer, milliseconds, defaults to 3000]
if(isBusy()) $cont.children().eq(0).remove();
transitionTo(gallery,index);
pause();
//Unpause the specific slide
if (config.resumeFromPause === true) {
timer = setInterval(function () { play(); }, config.speed);
}
};
};

Expand Down Expand Up @@ -228,7 +235,7 @@ speed : time each slide is shown [integer, milliseconds, defaults to 3000]
function addSlideLinks() {
$wrap.append('<p class="jshowoff-slidelinks '+uniqueClass+'-slidelinks"></p>');
$.each(gallery, function(i, val) {
var linktext = $(this).attr('title') != '' ? $(this).attr('title') : i+1;
var linktext = $(this).prop('title') != '' ? $(this).prop('title') : i+1;
$('<a class="jshowoff-slidelink-'+i+' '+uniqueClass+'-slidelink-'+i+'" href="#null">'+linktext+'</a>').bind('click', {index:i}, function(e){ goToAndPause(e.data.index); return false; }).appendTo('.'+uniqueClass+'-slidelinks');
});
};
Expand Down
7 changes: 1 addition & 6 deletions jquery.jshowoff.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.