2011-12-16 43 views

回答

0

試試這個小提琴http://jsfiddle.net/mdamC/149/

$("ul#links li a").unbind().bind('click', function(e) { 
    e.preventDefault(); 
    e.stopPropagation(); 
    $(this).toggleClass('active'); 
    $(".descriptions").fadeOut(); 
    //you must get the index of the parent <li> otherwise the index of the <a> is always 0! 
    var index = $(this).parent().index(); 

    $(".descriptions").eq(index).fadeIn(); 

    $('.active').removeClass('active'); 
    $(this).addClass('active'); 

}, function(e) { 
    $(".descriptions").stop().fadeOut(); 
}); 
+0

thansk夥計,我的本地版本的所有申報單上顯示無...!「!! – DD77 2011-12-16 13:06:38

0

喜用點擊的錨的HREF,越來越描述DIV和切換it.Please讓我知道,如果你正在尋找其他的東西修改你的代碼http://jsfiddle.net/mdamC/150/ Basicall。