我在jquery中使用同位素插件,如果是静态html代码块,效果会很好:
HTML:
<body>
<div id="target">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
JS:
$('#target > *').isotope([needle options]);但是,如果我使用" load“将内容加载到#target中,同位素会忽略它们。
JS:
$('#target').load('file',function()
{
$('#target > *').isotope([needle options]);
}
);请帮帮忙,这很重要。
发布于 2012-02-02 18:53:28
您可以实例化通过load检索到的各种div项。
参见同位素文档中的insert method。
$.ajax({
url: file,
success: function( data ) {
$('#target').isotope('insert', data);
}
});https://stackoverflow.com/questions/9111016
复制相似问题