jquery实现菜单切换

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jquery实现菜单切换</title> <mce:script src="../脚本/jquery-1.3.2.min.js" mce_src="脚本/jquery-1.3.2.min.js" type="text/javascript"></mce:script> <mce:script type="text/javascript"><!-- $(function(){ var $div=$("div.title span"); $div.bind("click",function(){ $(this).addClass("select").siblings().removeClass("select"); var $index=$div.index(this); $(".content div").eq($index).show().siblings().hide(); }) }) // --></mce:script> <mce:style type="text/css"><!-- .title { font-size:12px; width:100px; border:1px black; border-style:ridge; } .select { color:Aqua; } .content { font-size:14px; color:Maroon; border-color:Black; border-style:ridge; border:1px; width:100px; height:100px; } .content a { width:100px; height:100px; } .hide { display:none; } .selected { background-color:Red; } --></mce:style><style type="text/css" mce_bogus="1"> .title { font-size:12px; width:100px; border:1px black; border-style:ridge; } .select { color:Aqua; } .content { font-size:14px; color:Maroon; border-color:Black; border-style:ridge; border:1px; width:100px; height:100px; } .content a { width:100px; height:100px; } .hide { display:none; } .selected { background-color:Red; } </style> </head> <body> <div> <div class="title"> <span>体育</span> <span>娱乐</span> <span>Jquery</span> </div> <div class="content"> <div>体育信息就这这里www.163.com</div> <div class="hide">娱乐就这娱乐星空卫视</div> <div class="hide">blog.csdn.net/ws_hgo</div> </div> </div> </body> </html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值