雖然沒能用老是的方法實現出來,但是用jquery方法還是實現了這樣的效果:
$(document).ready(function(){
$(".notice-tit li").mouseover(function(){
$(".notice-tit li").eq($(this).index()).addClass("select").siblings().removeClass('select');
$(".notice-con div").hide().eq($(this).index()).show();
});
});
$(document).ready(function(){
$(".notice-tit li").mouseover(function(){
$(".notice-tit li").eq($(this).index()).addClass("select").siblings().removeClass('select');
$(".notice-con div").hide().eq($(this).index()).show();
});
});
2016-03-12
老師其實沒有用jquery,只是把根據id獲取對象的方法封裝成了一個名為 '$' 的方法
不過這樣很容易讓人理解錯T^T
不過這樣很容易讓人理解錯T^T
2016-02-03