6
4つのオプションを含む選択ボックスがあり、それぞれを選択して現在の.item
個のdivをすべて削除し、新しい.items
をロードしてアイソトープを使用して再配置します。アイソトープがAjax読み込みコンテンツで動作しない
$('.menu-select').change(function(){
var selected=$('.menu-select-option:selected').html().toLowerCase();
if(selected=='all')
{
loadContent('mixed_home_all.html');
}
if(selected=='recommended')
{
loadContent('mixed_home_reco.html');
}
if(selected=='popular')
{
loadContent('mixed_home_pop.html');
}
});
loadContent機能は次のようになります。何らかの理由で
function loadContent(filename){
var $item=$('.item');
$container.isotope('remove', $item);
$container.load(filename, function(){
$container.imagesLoaded(function(){
$container.isotope('reLayout');
});
});
}
、reLayout
が機能していません。クラスisotope-item
は個々のアイテムに追加されていません。コンソールログにエラーはありません。
こんにちは、私は正常にこのコードを適応し、うまく動作しますが、私のソートは、要素をリロードした後に動作していない...たぶん、あなたは私をHELOすることができます...ありがとう:私の
loadContent
関数は次のようになります! – vitaminasweb