Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
集成jQuery和Quicksand_Jquery_Html - Fatal编程技术网

集成jQuery和Quicksand

集成jQuery和Quicksand,jquery,html,Jquery,Html,我尝试将jQuery砌体与Quicksand集成,但没有成功。流沙起作用了,但砖石没起作用。 这是我的剧本: $(document).ready(function(){ // Clone portfolio items to get a second collection for Quicksand plugin var $portfolioClone = $(".theMagz").clone(); $(functio

我尝试将jQuery砌体与Quicksand集成,但没有成功。流沙起作用了,但砖石没起作用。 这是我的剧本:

$(document).ready(function(){

            // Clone portfolio items to get a second collection for Quicksand plugin
            var $portfolioClone = $(".theMagz").clone();

            $(function(){
                var $container = $('.theMagz');
                $container.imagesLoaded( function() {
                    $container.masonry({
                        gutterWidth:20
                    });
                });
            });

            // Attempt to call Quicksand on every click event handler
            $("#vers a").click(function(e){

                $("#vers li").removeClass("current");   

                // Get the class attribute value of the clicked link
                var $filterClass = $(this).parent().attr("class");

                if ( $filterClass == "all" ) {
                    var $filteredPortfolio = $portfolioClone.find(".item");
                } else {
                    var $filteredPortfolio = $portfolioClone.find(".item[data-type~=" + $filterClass + "]");
                }

                // Call quicksand
                $(".theMagz").quicksand( $filteredPortfolio, { 
                    duration: 800, 
                    easing: 'easeInOutQuad' 
                }, function(){
                    var $container = $('.theMagz');
                    $container.imagesLoaded( function() {
                        $container.masonry({
                            gutterWidth:20
                        });
                    });

                });

                $(this).parent().addClass("current");

                // Prevent the browser jump to the link anchor
                e.preventDefault();
            })
        });
我把砖石脚本放了两次,因为当我刚把quicksand脚本放在一起时,它在第一次加载时就不起作用了。
问题是,当我单击#vers a时,它将被排序,然后消失,因为magz给定高度=0。 有人知道怎么修吗