ここにポートフォリオセクションがあります... http: //bvh.delineamultimedia.com/?page_id = 2およびSuperbox-(http://toddmotto.com/introducing-superbox-the-reimagined-lightbox-gallery/)が機能していますしかし、流砂の「フィルター」リンクをクリックすると、スーパーボックスが無効になっているようです。これを修正する方法はありますか?これがJavaScriptです。なぜこれが起こっているのか、私は少し混乱しています。流砂は少し貪欲だと思いますが、確かではありません。
よろしくお願いします!
;(function($) {
$.fn.SuperBox = function(options) {
var superbox = $('<div class="superbox-show"></div>');
var superboximg = $('<img src="" class="superbox-current-img">');
var superboxclose = $('<div class="superbox-close"></div>');
superbox.append(superboximg).append(superboxclose);
return this.each(function() {
//$('.superbox-list').click(function() {
$('.superbox').on('click', '.superbox-list', function() {
var currentimg = $(this).find('.superbox-img');
var imgData = currentimg.data('img');
superboximg.attr('src', imgData);
if($('.superbox-current-img').css('opacity') == 0) {
$('.superbox-current-img').animate({opacity: 1});
}
if ($(this).next().hasClass('superbox-show')) {
superbox.toggle();
} else {
superbox.insertAfter(this).css('display', 'block');
}
$('html, body').animate({
scrollTop:superbox.position().top - currentimg.width()
}, 'medium');
});
$('.superbox').on('click', '.superbox-close', function() {
$('.superbox-current-img').animate({opacity: 0}, 200, function() {
$('.superbox-show').slideUp();
});
});
});
};
})(jQuery);