我已經寫了這個功能是一個水平手風琴,到目前爲止它運行良好,我已經將它添加到外部js文件中,並將其加載到每個頁面中,我想要什麼現在在主頁上,刪除懸停功能,並將顏色設置爲#CCC
。我用盡了一切,解開了一個,寬度相同再添懸停....取消某個頁面上的功能
http://uwptestsite.uwpistol.net/menu.html
這裏是測試頁面。
我寫的代碼就在這裏。
// JavaScript Document
$(document).ready(function(){
$(".letter-b").width(12);
$(".letter-b").css({"overflow":"hidden", "position":"relative"});
$(".letter-b a").hover(
function() {
$(this).parent().stop().animate({"width": "52"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-e").width(12);
$(".letter-e").css({"overflow":"hidden", "position":"relative"});
$(".letter-e a").hover(
function() {
$(this).parent().stop().animate({"width": "83"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-h").width(12);
$(".letter-h").css({"overflow":"hidden", "position":"relative"});
$(".letter-h a").hover(
function() {
$(this).parent().stop().animate({"width": "53"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-l").width(11);
$(".letter-l").css({"overflow":"hidden", "position":"relative"});
$(".letter-l a").hover(
function() {
$(this).parent().stop().animate({"width": "54"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "11"}, 300);
});
$(".letter-n").width(12);
$(".letter-n").css({"overflow":"hidden", "position":"relative"});
$(".letter-n a").hover(
function() {
$(this).parent().stop().animate({"width": "43"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-o").width(12);
$(".letter-o").css({"overflow":"hidden", "position":"relative"});
$(".letter-o a").hover(
function() {
$(this).parent().stop().animate({"width": "94"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-r").width(12);
$(".letter-r").css({"overflow":"hidden", "position":"relative"});
$(".letter-r a").hover(
function() {
$(this).parent().stop().animate({"width": "95"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-w").width(17);
$(".letter-w").css({"overflow":"hidden", "position":"relative"});
$(".letter-w a").hover(
function() {
$(this).parent().stop().animate({"width": "95"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "17"}, 300);
});
$(".letter-x").width(12);
$(".letter-x").css({"overflow":"hidden", "position":"relative"});
$(".letter-x a").hover(
function() {
$(this).parent().stop().animate({"width": "52"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
$(".letter-y").width(12);
$(".letter-y").css({"overflow":"hidden", "position":"relative"});
$(".letter-y a").hover(
function() {
$(this).parent().stop().animate({"width": "52"}, 300);
},
function() {
$(this).parent().stop().animate({"width": "12"}, 300);
});
});
我真的爲此而努力,我想我需要禁用的選項,但是這將是使其成爲該林不知道如何做一個插件..我不想每個頁面啓用鏈接項的列表,因爲它的增長速度在一分鐘,所以如果我可以這樣做
$("letter-h").disableAccordion();
我希望我做的意義,我知道有人能有一個解決方案,感謝這個!
我在這裏完全錯過了點,但如果你不希望在特定頁面上懸停功能,只是不包括.'js'文件包含'.hover()'func灰。 – andyb 2011-04-26 09:03:20