我試着去改變在我的超級鏈接點,在瀏覽器中調整大小,但我既擋住了我的全部鏈接或沒有人更改超鏈接的位置調整
var $w = window.innerWidth || document.documentElement.clientWidth;
if ($w > 1025) {
$('a.something').each(function (e) {
e.preventDefault();
location.href = "/products.html";
});
} else {
$('a.something').each(function (e) {
e.preventDefault();
location.href = "javascript:void(0);";
});
}
if ($w > 1025) {
$('.mainMenu > li').unbind().hover(function() {
$(this).find('.subMenu').stop().slideToggle(400);
});
} else {
$('.mainMenu > li').unbind().click(function (e) {
$(this).find('.subMenu').stop().slideToggle(400);
});
}
對不起,不明白你試圖達到什麼樣的錯誤?您的代碼中的哪個地方可以連接到resize事件?那些'.something's是什麼 - 他們是否存儲超鏈接?理想情況下,如果可能的話,準備代表你的問題的[Plunker](http://plnkr.co/)。 –