<div id="outer"> <ul id="tab"> <li class="current">tab标签</li> <li>qq在线客服代码</li> <li>css3</li> </ul> <div id="content"> <ul style="display:block;"> <a href="http://www.lanrenzhijia.com/tab">tab标签</a> </ul> <ul> <a href="http://www.lanrenzhijia.com/service">qq在线客服代码</a> </ul> <ul> <a href="http://www.lanrenzhijia.com/js/css3">css3</a> </ul> </div> </div> <!-- html代码end --> <script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script> <script> $(function(){ window.onload = function() { var $li = $(‘#tab li‘); var $ul = $(‘#content ul‘); $li.mouseover(function(){ var $this = $(this); var $t = $this.index(); $li.removeClass(); $this.addClass(‘current‘); $ul.css(‘display‘,‘none‘); $ul.eq($t).css(‘display‘,‘block‘); }) } }); </script>
时间: 2024-11-01 06:02:14