我想保持的背景圖像活動鏈接和懸停 對本網站活動鏈接背景
站點鏈接的導航欄:使用下面的代碼
$(document).ready(function() {
$('#navigation a[href^="#' + location.pathname.split("#")[1] + '"]').addClass('current');
});
http://67.23.226.231/~edutubei/onepage/#about
與下面的css
ul.navigation .current{
background:url(../images/current_page.png) no-repeat right bottom;
}
ul.navigation .current a, ul.navigation .current a:hover{
color:#FFF;
}
但這不起作用我如何保持背景圖像/突出顯示活動和懸停鏈接
這可能有助於發表一個例子。附加鏈接不起作用。 – lucuma 2013-04-05 19:11:36
您的網站是x_x – 2013-04-05 19:18:11
是'導航'一個'ID'或'類'?你的CSS應該讀取'a.current',如果你的javascript是要將該類添加到鏈接 – greener 2013-04-05 19:24:35