最佳答案
我为一个客户制作了一个页面,最初我使用的是 Chrome 浏览器,但是忘了检查它是否能在 Firefox 中工作。现在,我遇到了一个大问题,因为整个页面都基于一个在 Firefox 中无法工作的脚本。
它是基于所有的“链接”,有一个 rel
,导致隐藏和显示正确的网页。我不明白为什么这个在 Firefox 中不能工作。
例如,页面的 id 为 #menuPage
、 #aboutPage
等等。所有链接都有以下代码:
<a class="menuOption" rel='#homePage' href="#">Velkommen</a>
它在 Chrome 和 Safari 中运行良好。
密码如下:
$(document).ready(function(){
//Main Navigation
$('.menuOption').click(function(){
event.preventDefault();
var categories = $(this).attr('rel');
$('.pages').hide();
$(categories).fadeIn();
});
// HIDES and showes the right starting menu
$('.all').hide();
$('.pizza').show();
// Hides and shows using rel tags in the buttons
$('.menyCat').click(function(event){
event.preventDefault();
var categori = $(this).attr('rel');
$('.all').hide();
$(categori).fadeIn();
$('html,body').scrollTo(0, categori);
});
});