Created
May 21, 2012 21:25
-
-
Save xfenix/2764829 to your computer and use it in GitHub Desktop.
Shadowbox next/prev lightbox-like navigation implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shadowbox.init({ | |
onFinish : function(az) { | |
var navBtnRight = $("<div/>").addClass('shadowbox-nav shadowbox-next').html($("<a/>") .click(function(){Shadowbox.next();})); | |
var navBtnLeft = $("<div/>").addClass('shadowbox-nav shadowbox-prev').html($("<a/>").click(function(){Shadowbox.previous();})); | |
$("#sb-body-inner").prepend(navBtnRight ) | |
.prepend(navBtnLeft); | |
$('.shadowbox-nav').hover( | |
function() { | |
if( | |
( $(this).hasClass('shadowbox-next') && !Shadowbox.hasNext() ) | |
|| | |
( $(this).hasClass('shadowbox-prev') && Shadowbox.current == 0 ) | |
) | |
return true; | |
$(this).find('a').fadeIn(); | |
}, | |
function() { | |
$(this).find('a').fadeOut(); | |
} | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment