如何使用jquery同位素和mansory与angular指令

时间:2017-04-03 05:22:31

标签: jquery angularjs directive isotope

带角度指令的jquery

 var $document_body = $(document.body);
 var $portfolio_gallery = $(".gallery-isotope");
 var portfolio_filter = ".portfolio-filter a";
 var $portfolio_filter_first_child = $(".portfolio-filter a:eq(0)");
 var $portfolio_flex_slider = $(".portfolio-slider");
 var isotope_mode;
        if ($portfolio_gallery.hasClass("masonry")){
            isotope_mode = "masonry";
        } else{
            isotope_mode = "fitRows";
        }

        //isotope firsttime loading
        $portfolio_gallery.imagesLoaded(function(){
            $portfolio_gallery.isotope({
                itemSelector: '.gallery-item',
                layoutMode: isotope_mode,
                filter: "*"
            });
        });

        //isotope filter
        $document_body.on('click', portfolio_filter, function(e) {
            $(portfolio_filter).removeClass("active");
            $(this).addClass("active");
            var fselector = $(this).data('filter');

            $portfolio_gallery.isotope({
                itemSelector: '.gallery-item',
                layoutMode: isotope_mode,
                filter: fselector
            });
            return false;
        });

如何使用此jquery创建angular指令 并使用jqlite

在我的控制器中运行此jquery代码时,函数无法正常运行

##

0 个答案:

没有答案