2012-09-29 37 views
-4

这是我面临的问题 - 它发生有时只是:the problem 这是我的输出图像:jQuery的同位素不工作

我需要输出中相同Pintrest风格。

代码:

$(document).ready(function(){ 
     var $container = $('#content'); 
$container.isotope({ 
    filter: '*', 
    //layoutMode : '', 
     animationOptions: { 
    duration: 750, 
    easing: 'linear', 
    queue: false, 

    } 



}); 

$('#nav a').click(function(){ 
    var selector = $(this).attr('data-filter'); 
    $container.isotope({ 
    filter: selector, 
    animationOptions: { 
    duration: 750, 
    easing: 'linear', 
    queue: false, 

    } 
    }); 
    return false; 
}); 

}); 

解决: 问题解决了:)

+3

包括你的问题更多信息,粘贴代码,以便我们可以调试速度更快(HTML,JS等) –

+0

我不能在这里发表编辑的代码,所以这里是链接 http://bridgenit.com/home/bridgenit/stapr – behinddwalls

+0

为什么所有这些downvoting?问题是制定得不好,但相当清楚,他链接到在线沙箱加代码... – Systembolaget

回答

2

我对你的网站进行测试,这是你的答案:

$('#content').isotope({ 
    itemSelector:'.isotope-item', 
    layoutMode: 'fitRows' 
}); 

更改layoutMode为其他值这里可用:http://isotope.metafizzy.co/docs/layout-modes.html

Als Ø你的头JS应该是这样的:

<script type="text/javascript"> 
$(document).ready(function() { // Here you listen for the document ready event, when html, css, js are ready 
    $('#part1').load("home/" , function(){ $('#loading').remove();}); 
}); 
//hide frame on resizing the window 
$(window).bind('resize load', function(){ // here you listen for resize and load of images, iframes and others 
    if ($(window).width() < 1349) { 
    $('#frame').hide(); 
    $('#right').css('width' , '85%'); 
    } 
    else { 
    $('#frame').show(); 
    $('#right').css('width' , '72%'); 
    } 
}); 
</script> 
+0

我已经完成了过滤,然后applien'砌体'layoutmode ..但它仍然给予提到的问题在http://i.stack .imgur.com/9pUpq.png ...这个问题有时候会发生..不是每次都有...我的代码工作得很好.. – behinddwalls

+0

我正在尝试在我的网站中获得Pinterest样式的帖子 – behinddwalls