我在使用isotope.js的FF 36.0.1 Mac(最新版本)时遇到了问题。
我创建了一个可排序动画砌体库的3个实例,您可以在其中看到单击菜单,饮品菜单和酒单。
3个实例在除Firefox之外的所有浏览器上都能完美运行。
js代码是
/* FOOD MENUS */
$(window).load(function () {
var size = 1;
var button = 1;
var button_class = "menus-header-center-right-links-current";
var normal_size_class = "menus-content-center-normal";
var full_size_class = "menus-content-center-full";
var $container = $('#menus-content-center');
$container.isotope({itemSelector : 'div'});
function check_button(){
$('.menus-header-center-right-links').removeClass(button_class);
if(button==1){
$("#filter-midi").addClass(button_class);
$("#menus-header-center-left-title").html('Lunch menu');
}
if(button==2){
$("#filter-soir").addClass(button_class);
$("#menus-header-center-left-title").html('Dinner menu');
}
}
$("#filter-midi").click(function() { $container.isotope({ filter: '.midi' }); button = 1; check_button(); });
$("#filter-soir").click(function() { $container.isotope({ filter: '.soir' }); button = 2; check_button(); });
});
/* WINE LIST */
$(window).load(function () {
var size = 1;
var button = 1;
var button_class = "wine-header-center-right-links-current";
var normal_size_class = "wine-content-center-normal";
var full_size_class = "wine-content-center-full";
var $container = $('#wine-content-center');
$container.isotope({itemSelector : 'ul'});
function check_button(){
$('.wine-header-center-right-links').removeClass(button_class);
if(button==1){
$("#filter-all").addClass(button_class);
$("#wine-header-center-left-title").html('All');
}
if(button==2){
$("#filter-white").addClass(button_class);
$("#wine-header-center-left-title").html('White');
}
if(button==3){
$("#filter-red").addClass(button_class);
$("#wine-header-center-left-title").html('Red');
}
if(button==4){
$("#filter-rose").addClass(button_class);
$("#wine-header-center-left-title").html('Rosé');
}
if(button==5){
$("#filter-moelleux").addClass(button_class);
$("#wine-header-center-left-title").html('Moëlleux');
}
if(button==6){
$("#filter-champagne").addClass(button_class);
$("#wine-header-center-left-title").html('Champagne');
}
if(button==7){
$("#filter-verre").addClass(button_class);
$("#wine-header-center-left-title").html('Glass of wine');
}
if(button==8){
$("#filter-bottle").addClass(button_class);
$("#wine-header-center-left-title").html('Bottles');
}
if(button==9){
$("#filter-luxo").addClass(button_class);
$("#wine-header-center-left-title").html('Luxembourg Wines');
}
}
$("#filter-all").click(function() { $container.isotope({ filter: '.all' }); button = 1; check_button(); });
$("#filter-white").click(function() { $container.isotope({ filter: '.white' }); button = 2; check_button(); });
$("#filter-red").click(function() { $container.isotope({ filter: '.red' }); button = 3; check_button(); });
$("#filter-rose").click(function() { $container.isotope({ filter: '.rose' }); button = 4; check_button(); });
$("#filter-moelleux").click(function() { $container.isotope({ filter: '.moelleux' }); button = 5; check_button(); });
$("#filter-champagne").click(function() { $container.isotope({ filter: '.champagne' }); button = 6; check_button(); });
$("#filter-verre").click(function() { $container.isotope({ filter: '.verre' }); button = 7; check_button(); });
$("#filter-bottle").click(function() { $container.isotope({ filter: '.bottle' }); button = 8; check_button(); });
$("#filter-luxo").click(function() { $container.isotope({ filter: '.luxo' }); button = 9; check_button(); });
});
/* DRINKS MENU */
$(window).load(function () {
var size = 1;
var button = 1;
var button_class = "drinks-header-center-right-links-current";
var normal_size_class = "drinks-content-center-normal";
var full_size_class = "drinks-content-center-full";
var $container = $('#drinks-content-center');
$container.isotope({itemSelector : 'div'});
function check_button(){
$('.drinks-header-center-right-links').removeClass(button_class);
if(button==1){
$("#filter-all-drinks").addClass(button_class);
$("#drinks-header-center-left-title").html('All Drinks');
}
if(button==2){
$("#filter-free").addClass(button_class);
$("#drinks-header-center-left-title").html('Alcohol free');
}
if(button==3){
$("#filter-apero").addClass(button_class);
$("#drinks-header-center-left-title").html('Aperitif');
}
if(button==4){
$("#filter-spirit").addClass(button_class);
$("#drinks-header-center-left-title").html('Spirits');
}
}
$("#filter-all-drinks").click(function() { $container.isotope({ filter: '.all-drinks' }); button = 1; check_button(); });
$("#filter-free").click(function() { $container.isotope({ filter: '.free' }); button = 2; check_button(); });
$("#filter-apero").click(function() { $container.isotope({ filter: '.apero' }); button = 3; check_button(); });
$("#filter-spirit").click(function() { $container.isotope({ filter: '.spirit' }); button = 4; check_button(); });
});
感谢您的帮助! :)