【问题标题】:Superbox JS & Quicksand Combo IssueSuperbox JS 和流沙组合问题
【发布时间】:2013-03-26 02:12:31
【问题描述】:

我在这里有一个投资组合部分...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);

【问题讨论】:

    标签: javascript jquery quicksand


    【解决方案1】:

    当流沙过滤器处于活动状态时,它会为filterable-grid ul 设置一个新高度,并设置overflow:hidden 以隐藏超级框不被显示.. 正在正确调用它,它只是隐藏在ul.. 溢出可能需要修改 quicksand 脚本或寻找其他解决方法..

    【讨论】:

    • 我在想这样的东西 $('.superbox').on('click', '.superbox-list', function() { 而不是 $('.superbox-list' ).click(function() {
    • 这与 QuickSand 插件有关。每次过滤ul时,插件都会为ul设置一个特定的高度,还会在ul中添加overflow: hidden。如果你没有QS插件的缩小版,你可以运行搜索overflow 并进行相应更改.. 我已经通过 chrome 中的代码检查器删除了overflow,它工作正常..
    • 啊,我明白你在说什么。让我看看能不能找到。
    • 或者,您可以将其添加到您的超级框点击功能中:$('ul.filterable-grid').css({overflow: 'visible'});
    • 随时!喜欢那个 QS 插件,我用过很多次。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-20
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    相关资源
    最近更新 更多