1
你好,我試圖創建圖像庫的循環jQuery的插件http://leandrovieira.com/projects/jquery/lightbox/。 (當到達最後一個圖像顯示下一步按鈕的第一影像,或當它首先顯示的圖像,爲最後的圖像顯示上一個按鈕)到目前爲止,我還發現,我需要改變這些行:讓循環jQuery的燈箱
// Show the prev button, if not the first image in set
if (settings.activeImage != 0) {
if (settings.fixedNavigation) {
$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
.unbind()
.bind('click',function() {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
return false;
});
} else {
// Show the images button for Next buttons
$('#lightbox-nav-btnPrev').unbind().hover(function() {
$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
},function() {
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
}).show().bind('click',function() {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
return false;
});
}
}
// Show the next button, if not the last image in set
if (settings.activeImage != (settings.imageArray.length -1)) {
if (settings.fixedNavigation) {
$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
.unbind()
.bind('click',function() {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
return false;
});
} else {
// Show the images button for Next buttons
$('#lightbox-nav-btnNext').unbind().hover(function() {
$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
},function() {
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
}).show().bind('click',function() {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
return false;
});
}
}
我在jquery中的知識是基本的,所以也許有人可以幫忙?