所以我的问题是:我使用isotope并且我有高度问题。它无法在平板电脑/ iPad上计算出正确的高度 - 它会在顶部崩溃。台式机和智能手机工作正常。
这是我的同位素代码:
$(window).load(function() {
var $container = $('.isotope').isotope({
itemSelector: '.item',
layoutMode: 'masonry',
transitionDuration: '0.7s'
});
$('.isotope-filters').on('click', 'a', function () {
var filterValue = $(this).attr('data-filter');
$container.isotope({
filter: filterValue
});
// active state
var active =
$(this),
activeClass = active.data('filter'),
parentFilters = active.closest('.isotope-filters');
if (active.hasClass('selected')) {
return false;
}
parentFilters.find('a').removeClass('active');
active.addClass('active');
parentFilters.next().find('.isotope').addBack('.isotope').isotope({
filter: active.attr('data-filter')
});
return false;
});
});