
代码如下:
script>
$(document).ready(function() {
$(".tab span:first").addClass("current"); //为第一个SPAN添加当前效果样式
$(".tab ul:not(:first)").hide(); //隐藏其它的UL
$(".tab span").mouseover(function() {
$(".tab span").removeClass("current"); //去掉所有SPAN的样式
$(this).addClass("current");
$(".tab ul").hide();
$("." + $(this).attr("id")).fadeIn('slow');
});
});
script>
tab1 tab2 tab3
脚本之家www.gxlcms.com我和我 一花一世办一草一天堂 阿里巴巴阿里巴巴一草一天堂我和我的祖国最爱的地方 演示代码 http://demo.jb51.net/js/jquery_tab/index.htm