一段折叠菜单JS,百用不爽
代码:
提示:你可以先修改部分代码再运行。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery插件Tab选项卡-选择指定栏</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.idTabs.js"></script>
<style type="text/css">
/*主容器*/
.usual {
background:#cee;
color:#111;
padding:15px 20px;
width:500px;
border:1px solid #099;
margin:8px auto;
}
/*选项卡*/
.usual ul {
margin:0;
padding:0;
padding-left:2em;
overflow:auto;/*火狐等清理浮动*/
_display:inline-block;/*ie6清理浮动*/
}
.usual li {
list-style:none;
float:left;
}
.usual ul a {
display:block;
padding:6px 10px;
text-decoration:none;
font:12px Arial;
color:#FFF;
background:#22A4C4;
outline:none;
}
.usual ul a:hover {
color:#FFF;
background:#0B718B;
}
.usual ul a.selected {
color:#000;
background:snow;
cursor:default;
}
/*tab页*/
.usual div {
padding:10px 10px 8px 10px;
background:snow;
font:10pt Arial;
}
</style>
</head>
<body>
<div id="usual1" class="usual">
<ul>
<li><a href="#tab1">教育</a></li>
<li><a href="#tab2">儿童</a></li>
<li><a href="#tab3">育儿</a></li>
</ul>
<div id="tab1">金融危机致使校园招聘减少...</div>
<div id="tab2">青少年网上普法大赛...</div>
<div id="tab3">今天你为宝宝许愿了吗...</div>
</div>
<script type="text/javascript">
$("#usual1 ul").idTabs("tab2"); //代码选择第二栏 ,留空默认第一个
</script>
</body>
</html> |
/*任意位置浮动固定层*/
/*没剑(http://regedit.cnblogs.com) 08-03-11*/
/*说明:可以让指定的层浮动到网页上的任何位置,当滚动条滚动时它会保持在当前位置不变,不会产生闪动*/
……
诸如jQuery, MooTools, Prototype, Dojo和YUI等javascript脚本库,大家都已经很熟悉。但这些脚本库有利也有弊——比如说JavaScript文件过大的问题。有时你可能会愿意采用一些体积小巧、专注于特定任务的JavaScript脚本库。
1、$fx()
简介:$fx()是一个轻量级的动画库,一些复杂的动画,可以由多个简单的动画效果进行组合,但是提供的是混淆压缩过的代码,对于研究动画源码的朋友可能特别不爽
API:http://fx.inetcat.com/manuals.php
主页:http://fx.inetcat.com/
2、JSTweener
简介:原始大小14K,支持大多数的动画特效
演示地址:http://svn.coderepos.org/share/l … es/transitions.html
主页地址:http://coderepos.org/share/wiki/JSTweener
……
http://www.cn-cuckoo.com
http://www.douban.com/review/2332407/
http://www.jqueryajax.com/
http://www.qianduan.net
http://www.ijavascript.cn/jquery/index.html
jQuery 是继 prototype 之后又一个优秀的 Javascript 框架。其宗旨是—写更少的代码,做更多的事情。它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不 及的,它兼容 CSS3,还兼容各种浏览器(IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)。 jQuery 是一个快速的,简洁的 javaScript 库,使用户能更方便地处理 HTML documents、events、实现动画效果,并且方便地为网站提供 AJAX 交互。 jQuery 还有一个比较大的优势是,它的文档说明很全,而且各种应用也说得很详细,同时还有许多成熟的插件可供选择。 jQuery 能够使用户的 html 页保持代码和 html 内容分离,也就是说,不用再在 html 里面插入一堆js来调用命令了,只需定义 id 即可。今天在Kollermedia.at上发现了一篇JQuery插件列表的文章,特推荐如下。
……
Lee dialog
http://www.okajax.com/demo/dialog/
dialog UI
http://malsup.com/jquery/block/#demos
DOMWindowDemo
http://swip.codylindley.com/DOMWindowDemo.html
SimpleModal
http://www.ericmmartin.com/projects/
jQuery做的图片轮换效果,图片上下左右移动,文字,全部兼顾到了,很不错的说… DEMO