在this page的右欄中有 四個導航項。第一個導航項目「The Baltimore Orioles」onmouseover顯示了3個子導航項目。Su魚下拉onclick
我該如何擺脫onmouseover並讓它僅在用戶點擊時顯示3個子na?我添加onclick腳本,但沒有運氣。
在this page的右欄中有 四個導航項。第一個導航項目「The Baltimore Orioles」onmouseover顯示了3個子導航項目。Su魚下拉onclick
我該如何擺脫onmouseover並讓它僅在用戶點擊時顯示3個子na?我添加onclick腳本,但沒有運氣。
您需要從CSS中刪除a:hover。
下面是我使用的JS,但它不工作onClick。
http://www.ebenoit.com/client/EJB/suckerfish-dropdown.html
<script type="text/javascript">
$(document).ready(function(){
$("#nav-one li").click(
function(){ $("ul", this).slideDown("fast"); },
function() { }
);
if (document.all) {
$("#nav-one li").hoverClass ("sfHover");
}
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};
</script>