日期:2014-05-16 浏览次数:20420 次
<!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" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <title>test-csdn-slide</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <style type="text/css"> *{ margin:0; padding:0;} body{ background:#3f3f3f;font:12px/2 arial;} ul,li{list-style-type:none;} a{color:#24d;text-decoration:none;} a:hover{color:#e40000;text-decoration:underline;} a:focus{outline:0;} .container{ width:1000px; margin:0 auto; background:#fff; overflow:hidden; padding:15px;} .silder{ float:left; width:200px; height:500px; border-right:1px solid #ccc;} .main{ float:right; width:770px;} </style> </head> <body> <div class="container"> <div class="silder"> <ul class="slide_menu"> <li><a href="#"><span></span>我的首页</a></li> <li><a href="#"><span></span>我的博客</a></li> <li><a href="#"><span></span>我的心情日记</a></li> </ul> </div> <div class="main"> <ul class="main_cont"> <li>我是首页内容</li> <li style="display:none;">我的博客内容</li> <li style="display:none;">我的心情日记内容</li> </ul> </div> </div> <script type="text/javascript"> function s_menu(){ $('.slide_menu>li').click(function(){ var iVal = $(this).index(); $('.main_cont>li').eq(iVal).show().siblings('li').hide(); return false; }); } s_menu(); </script> </body> </html>