<!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>
<script type="text/网页特效" src="js/jquery-1.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//get all the li from the #tabmenu ul
$('#tabmenu > li').click(function(){
//remove the selected class from all li
$('#tabmenu > li').removeclass('selected');
//reassign the li
$(this).addclass('selected');
//hide all the div in .boxbody
$('.boxbody div').slideup('1500');
//look for the right div in boxbody according to the navigation ul index, therefore, the arrangement is very important.
$('.boxbody div:eq(' + $('#tabmenu > li').index(this) + ')').slidedown('1500');
}).mouseo教程ver(function() {
//add and remove class, personally i dont think this is the right way to do it, anyone please suggest
$(this).addclass('mouseover');
$(this).removeclass('mouseout');
}).mouseout(function() {
//add and remove class
$(this).addclass('mouseout');
$(this).removeclass('mouseover');
});
//mouseover with animate effect for category menu list
$('.boxbody #category li').mouseover(function() {
//change background color and animate the padding
$(this).css教程('backgroundcolor','#888');
$(this).children().animate({paddingleft:"20px"}, {queue:false, duration:300});
}).mouseout(function() {
//change background color and animate the padding
$(this).css('backgroundcolor','');
$(this).children().animate({paddingleft:"0"}, {queue:false, duration:300});
});
//download by http://www.111cn.net
//mouseover effect for posts, comments, famous posts and random posts menu list.
$('.boxbody li').click(function(){
window.location = $(this).find("a").attr("href");
}).mouseover(function() {
$(this).css('backgroundcolor','#888');
}).mouseout(function() {
$(this).css('backgroundcolor','');
});
});
</script>
<style>
body{font-family:arial;font-size:10px;color:#ccc;background-color:#555}
a {color:#ccc;text-decoration:none;}
a:hover {color:#ccc;text-decoration:none}
#tabmenu {margin:0;padding:0 0 0 15px;list-style:none;}
#tabmenu li {float:left;height:32px;width:39px;cursor:pointer;cursor:hand}
li.comments {background:url(images/tabcomment.gif) no-repeat 0 -32px;}
li.posts {background:url(images/tabstar.gif) no-repeat 0 -32px;}
li.category {background:url(images/tabfolder.gif) no-repeat 0 -32px;}
li.famous {background:url(images/tabheart.gif) no-repeat 0 -32px;}
li.random {background:url(images/tabrandom.gif) no-repeat 0 -32px;}
li.mouseover {background-position:0 0;}
li.mouseout {background-position:0 -32px;}
li.selected {background-position:0 0;}
.box {width:227px}
.boxtop {background:url(images/boxtop.gif) no-repeat;height:11px;clear:both}
*html .boxtop {margin-bottom:-2px;}
.boxbody {background-color:#282828;}
.boxbottom {background:url(images/boxbottom.gif) no-repeat;height:11px;}
.boxbody div {display:none;}
.boxbody div.show {display:block;}
.boxbody #category a {display:block;}
.boxbody div ul {margin:0 10px 0 25px;padding:0;width:190px;list-style-image:url(images/arrow.gif)}
*html .boxbody div ul {margin-left:10px;padding-left:15px;}
.boxbody div li {border-bottom:1px dotted #8e8e8e; padding:4px 0;cursor:hand;cursor:pointer;}
.boxbody div ul li.last {border-bottom:none}
.boxbody div li span {font-size:8px;font-style:italic; color:#888;}
</style>
</head>
<body>
<h2><a href="http://www.111cn.net">jquery tabbed side menu from queness webblog</a></h2>
<div class="box">
<ul id="tabmenu">
<li class="posts selected"></li>
<li class="comments"></li>
<li class="category"></li>
<li class="famous"></li>
<li class="random"></li>
</ul>
<div class="boxtop"></div>
<div class="boxbody">
<div id="posts" class="show">
<ul>
<li>create a simple css + javascript tooltip with jquery.</li>
<li>simple jquery modal window tutorial.</li>
<li>navigation list menu + jquery animate effect tutorial.</li>
<li>exclusive rss icons from queness.</li>
<li>50 monochromatic website designs.</li>
<li>food plates and creative dishware designs.</li>
<li>breadcrumbs in web design: examples and best practices.</li>
<li class="last">new smashing freebies for designers and bloggers.</li>
</ul>
</div>
<div id="comments">
<ul>
<li><a>jquery tabbed navigation menu. <span> - kevin</span></a></li>
<li><a>you can add links in here! <span> - kevin</span></a></li>
<li><a>it's easy to understand. though it's not the best, but hell yeah it works. <span> - kevin</span></a></li>
<li><a>i hope you will like it. <span> - kevin</span></a></li>
<li><a>my next tutorial will be jquery-based accordion. <span> - kevin</span></a></li>
<li class="last"><a>and, i'm working on a free wordpress template as well : ) <span> - kevin</span></a></li>
</ul>
</div>
<div id="category">
<ul>
<li><a href="http://www.111cn.net/tag/ajax">ajax</a></li>
<li><a href="http://www.111cn.net/tag/css-html">css-html</a></li>
<li><a href="http://www.111cn.net/tag/freebies">freebies</a></li>
<li><a href="http://www.111cn.net/tag/icon">icon</a></li>
<li><a href="http://www.111cn.net/tag/inspiration">inspiration</a></li>
<li><a href="http://www.111cn.net/tag/javascript">javascript</a></li>
<li><a href="http://www.111cn.net/tag/logo">logo</a></li>
<li><a href="http://www.111cn.net/tag/photography">photography</a></li>
<li><a href="http://www.111cn.net/tag/photoshop">photoshop</a></li>
<li><a href="http://www.111cn.net/tag/php">php</a></li>
<li><a href="http://www.111cn.net/tag/seo">seo</a></li>
<li><a href="http://www.111cn.net/tag/tutorial">tutorial</a></li>
<li><a href="http://www.111cn.net/tag/usability">usability</a></li>
<li><a href="http://www.111cn.net/tag/wallpaper">wallpaper</a></li>
<li class="last"><a href="http://www.111cn.net/tag/wordpress">wordpress</a></li>
</ul>
</div>
<div id="famous">
<ul>
<li>simple jquery modal window tutorial.</li>
<li>create a simple css + javascript tooltip with jquery.</li>
<li>navigation list menu + jquery animate effect tutorial.</li>
<li class="last">exclusive rss icons from queness.</li>
</ul>
</div>
<div id="random">
<ul>
<li>50 monochromatic website designs.</li>
<li>breadcrumbs in web design: examples and best practices.</li>
<li>simple jquery modal window tutorial.</li>
<li>navigation list menu + jquery animate effect tutorial.</li>
<li>create a simple css + javascript tooltip with jquery.</li>
<li>exclusive rss icons from queness.</li>
<li>new smashing freebies for designers and bloggers.</li>
<li class="last">food plates and creative dishware designs.</li>
</ul>
</div>
</div>
<div class="boxbottom"></div>
</div>
<div style="font-size:10px;color:#ccc">except where otherwise noted, content on this site is licensed under a creative commons attribution 3.0 license.</div>
</body>
</html>
|