У меня есть этот простой контент подкачки скрипт:Срабатывание изотопа relayout в содержании подкачка JS
$(function(){
function contentSwitcher(settings){
var settings = {
contentClass : '.project-view',
navigationId : '#projects-nav'
};
//Hide all of the content except the first one on the nav
$(settings.contentClass).not(':first').hide();
$(settings.navigationId).find('li:first').addClass('active');
//onClick set the active state,
//hide the content panels and show the correct one
$(settings.navigationId).find('a').click(function(e){
var contentToShow = $(this).attr('href');
contentToShow = $(contentToShow);
//dissable normal link behaviour
e.preventDefault();
//set the proper active class for active state css
$(settings.navigationId).find('li').removeClass('active');
$(this).parent('li').addClass('active');
//hide the old content and show the new
$(settings.contentClass).hide();
contentToShow.show();
$container.isotope('reLayout');
});
}
contentSwitcher();
});
Я пытаюсь добавить триггер для изотопного relayout в нем
$container.isotope('reLayout');
Но я не могу показаться, чтобы получить его, чтобы вызвать. Начальная вкладка загружается нормально, а вторая - все рушится. Что я делаю не так?
Какой версии изотопа вы используете. В качестве альтернативы вы можете использовать метод append для добавления своих элементов в свой контейнер: http://isotope.metafizzy.co/methods.html#appended –