一位朋友問我爲他的網站添加一些下拉菜單。它在這裏:http://importingacartospain.com/爲什麼我不能點擊這些鏈接?非常討厭的css/html錯誤
由於某些原因,我無法點擊下拉鍊接。我肯定錯過了什麼。任何人都可以看看嗎?
謝謝!
一位朋友問我爲他的網站添加一些下拉菜單。它在這裏:http://importingacartospain.com/爲什麼我不能點擊這些鏈接?非常討厭的css/html錯誤
由於某些原因,我無法點擊下拉鍊接。我肯定錯過了什麼。任何人都可以看看嗎?
謝謝!
這是對tabs.js返回false線43 return false;
取消事件的行爲,在這種情況下點擊鏈接。因此不冒泡的事件,並默認操作將不被考慮的鏈接裏面tabs.js
/***************************/
//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
//@website: www.yensdesign.com
//@email: [email protected]
//@license: Feel free to use it, but keep this credits please!
/***************************/
$(document).ready(function(){
$(".menu > li").click(function(e){
switch(e.target.id){
case "news":
//change status & style menu
$("#news").addClass("active");
$("#tutorials").removeClass("active");
$("#links").removeClass("active");
//display selected division, hide others
$("div.news").fadeIn();
$("div.tutorials").css("display", "none");
$("div.links").css("display", "none");
break;
case "tutorials":
//change status & style menu
$("#news").removeClass("active");
$("#tutorials").addClass("active");
$("#links").removeClass("active");
//display selected division, hide others
$("div.tutorials").fadeIn();
$("div.news").css("display", "none");
$("div.links").css("display", "none");
break;
case "links":
//change status & style menu
$("#news").removeClass("active");
$("#tutorials").removeClass("active");
$("#links").addClass("active");
//display selected division, hide others
$("div.links").fadeIn();
$("div.news").css("display", "none");
$("div.tutorials").css("display", "none");
break;
}
//alert(e.target.id);
// * Returning false here is canceling the click event of your links.
return false;
});
});
謝謝!你爲我節省了30分鐘的調試時間! – 2012-02-20 20:53:13
我在IE9和Chrome中看到了同樣的問題。
這似乎是有問題的代碼:
<script type="text/javascript" src="http://importingacartospain.com/wp-content/themes/AutoMagWp/jquery-fonteffect-1.0.0.js"></script>
不過我也建議固定結構/語義錯誤,首先是:http://validator.w3.org/check?uri=http%3A%2F%2Fimportingacartospain.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0
你的點擊處理程序返回false。嘗試刪除return false;
聲明。
其中包括jQuery的兩個版本。 – j08691 2012-02-20 20:39:18
奧赫:)兩個jQs? whhaaa!這不是我的代碼btw,我只是硬編碼下拉菜單。 – 2012-02-20 20:44:29