JavaScript 经典效果集

来源:互联网 发布:类似回家吃饭的软件 编辑:程序博客网 时间:2024/04/28 01:20
 一 实用且必用的小脚本代码
二 鼠标旁边的提示信息,类似与163登录后的页面提示效果
三 如果文字过长,则将过长的部分变成省略号显示
四 滚动的图片
五 接收键盘指令的脚本
六 让你的文本链接渐隐渐显
七 类似与QQ的好友/黑名单之类的树型菜单-----推荐
八 很多的脚本翻页------推荐
九 DIV的透明层实现
十 JSP页面自动生成html页面/或任何格式页面-----推荐
十一 超级强大的表单验证-----推荐
十二 漂亮的脚本日历
十三 进入,退出页面的各种效果!
十四 很酷的效果,表格被选中回变颜色
十五 弹出提示的效果
十六 图片之间的切换
十七 DIV_圆边圆角的实现
十八 跳动的菜单
十九 通过页面抓取照片
二十 客户端静态页面玩分页
二十一 类似与google个性页面的好东东------网友155120
二十二 漂亮的表格
二十三 经典的带阴影的可拖动的浮动层------网友marvellous--------推荐
二十四 运行代码的代码------网友:Lenvo
二十五 凹陷文字------------网友:Lenvo
二十六 漂亮的仿flash菜单---网友:Lenvo
二十七 自定义容器和字体大小---网友:greengnn
二十八 超级REAL视频播放器---网友:leaf52
二十九 网站论坛上面快捷键提交表单的方法---网友:greengnn
三 十 accesskey 提交---网友:greengnn
三十一 新闻广告图片切换效果+描述---网友:greengnn
三十二 菜单特效---网友:greengnn
三十三 采用CSS和JS的下拉菜单---网友:greengnn
三十四 一个漂亮的菜单---网友:chyf1982
三十五 滚屏显示---网友:33o3
三十六 制作特殊字的脚本
三十七 美化列表
三十八 CSS模仿IE警告信息栏---网友:独来读网
三十九 文字幻灯片---网友:独来读网
四 十 一个非常不错的loading 效果---网友:sungla
四十一 文字滚动---网友:powerzl
四十二 可拖动窗口,附带鼠标控制渐变透明---网友:lionhoho
四十三 繁简体文字转换工具---网友:newlethe
四十四 收集整理的四个方向的滚动---网友:newlethe
四十五 将HTML自动转为JS代码---网友:liaoyizhi520
四十六 锁定表列---网友:liaoyizhi520
四十七 滚动的图片---网友:z3333426
四十八 放大镜特效---网友:thw416
四十九 无名,感觉像黑克帝国---网友:cnbohu
五 十 美丽的菜单---网友:9999999999999
五十一 没有控制拦的REALL播放器---网友:9999999999999
五十二 荧光效果---网友:9999999999999
五十三 滚动效果---网友:wuleying
五十四 用层模拟可移动的小窗口---网友:goodrose
五十五 小方块---网友:leobluewing
五十五 文字包围图片的效果
五十六 无图片实现圆角框
五十七 图片预加载的使用
五十八 数字选中放大
五十九 很帅的一个效果
六十 文本编辑器
六十一 JSP页面不缓存
六十二 图片淡如淡出
六十三 给图片添加图片的倒影
六十四 取得页面的大小 宽高等各种信息
六十五 漂亮的表格
六十六 透明的Div提示
六十七 来访统计
六十八 地震效果---网友:zjewfq
六十九 Firefox的加入收藏代码---网友:MKDuse [^_^]
七 十 双击鼠标滚动屏幕的代码---网友:anyforever
七十一 隐藏Div入门---网友:anyforever
七十二 页面顶部颜色渐变特效---网友:utem123
七十三 图片渐变切换---网友:utem123
七十四 对联广告---网友:virusG
七十五 旋转变换文字---网友:junly0626
七十六 逐个出现的文字---网友:junly0626
七十七 炽热的文字---网友:junly0626
七十八 等着你来写咯 ^_^

一 些很实用且必用的小脚本代码:

脚本1:进入主页以后自动播放声音
<embed src="pnm://10.13.31.90/~kayvin/mihunji.rm" hidden=true autostart=true loop=true>

脚本2:进入主页后自动最大话,省的去在自己单击了
<script>
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
</script>

脚本3:显示现在时间的脚本
<script language=vbscript>document.write now</script>

脚本4:显示最后修改时间的脚本
<script>document.write(document.lastModified)</script>

脚本5:设为首页,加为收藏,加入频道,启动outlook发信
<a style="cursor:hand" 
onclick="this.style.behavior="url(#default#homepage)";
this.setHomePage("yourURL">设为首页</a>

<a style="cursor:hand"
onclick="window.external.AddFavorite(location.href,document.title);">加入收藏</a>

<a href=javascript:window.external.addChannel("typhoon.cdf")>加入频道</a>

<a href="youEmail">与我联系</a>

脚本6:状态栏动态显示现在时间
<script>
function see(){
window.setTimeout("see()",1000);
today = new Date();
self.status = today.toString();
}
</script>
<body onload=see()>

脚本7:关闭窗口的脚本
<a href=javascript:close()>[关闭窗口]</a>

脚本8:按下F12键,直接返回首页
<script>function look(){
if(event.keyCode==123){document.location.href=http://10.13.31.90/~kayvin/}
}
if(document.onkeydown==null)
{document.onkeydown=look}
</script>

脚本9:后退,刷新,前进
<input type=button value=后退 onclick=history.go(-1)>
<input type=button value=刷新 onclick=history.go(-0)>

<input type=button value=前进 onclick=history.go(+1)>

脚本10:设定时间弹出窗口,4000=4秒,当然你可以自定义

<script>function l() {
window.open(
"yourURL","name","width=500,height=150,border=0"
)
}

setTimeout(
"l()",4000
)
</script>

二 鼠标旁边的提示信息,类似与163登录后的页面提示效果

提示:您可以先修改部分代码再运行

三 如果文字过长,则将过长的部分变成省略号显示

提示:您可以先修改部分代码再运行
四 滚动的图片

提示:您可以先修改部分代码再运行
五 接收键盘指令的脚本

按A就会跳转到娃娃亲的网页,请按A

提示:您可以先修改部分代码再运行

六 让你的文本链接渐隐渐显

提示:您可以先修改部分代码再运行

七 类似与QQ的好友/黑名单之类的树型菜单_极品

提示:您可以先修改部分代码再运行

八 很多的脚本翻页
<textarea rows="12" cols="95" name="runcode6">&lt;!doctype html public &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;head&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;&lt;title&gt; JavaScript: showPages v1.0 [by Lapuasi.com]&lt;/title&gt;&lt;script language=&quot;JavaScript&quot;&gt;&lt;!--/*showPages v1.1=================================Infomation----------------------Author : LapuasiE-Mail : lapuasi@gmail.comWeb : http://www.lapuasi.comDate : 2005-11-17Example----------------------var pg = new showPages('pg');pg.pageCount = 12; //定义总页数(必要)pg.argName = 'p'; //定义参数名(可选,缺省为page)pg.printHtml(); //显示页数Supported in Internet Explorer, Mozilla Firefox*/function showPages(name) { //初始化属性this.name = name; //对象名称this.page = 1; //当前页数this.pageCount = 1; //总页数this.argName = 'page'; //参数名this.showTimes = 1; //打印次数}showPages.prototype.getPage = function(){ //丛url获得当前页数,如果变量重复只获取最后一个var args = location.search;var reg = new RegExp('[\?&amp;]?' + this.argName + '=([^&amp;]*)[&amp;$]?', 'gi');var chk = args.match(reg);this.page = RegExp.$1;}showPages.prototype.checkPages = function(){ //进行当前页数和总页数的验证if (isNaN(parseInt(this.page))) this.page = 1;if (isNaN(parseInt(this.pageCount))) this.pageCount = 1;if (this.page &lt; 1) this.page = 1;if (this.pageCount &lt; 1) this.pageCount = 1;if (this.page &gt; this.pageCount) this.page = this.pageCount;this.page = parseInt(this.page);this.pageCount = parseInt(this.pageCount);}showPages.prototype.createHtml = function(mode){ //生成html代码var strHtml = '', prevPage = this.page - 1, nextPage = this.page + 1;if (mode == '' || typeof(mode) == 'undefined') mode = 0;switch (mode) {case 0 : //模式1 (页数,首页,前页,后页,尾页)strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;';strHtml += '&lt;span class=&quot;number&quot;&gt;';if (prevPage &lt; 1) {strHtml += '&lt;span title=&quot;First Page&quot;&gt;«&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;‹&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;«&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;‹&lt;/a&gt;&lt;/span&gt;';}for (var i = 1; i &lt;= this.pageCount; i++) {if (i &gt; 0) {if (i == this.page) {strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;[' + i + ']&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + i + ');&quot;&gt;[' + i + ']&lt;/a&gt;&lt;/span&gt;';}}}if (nextPage &gt; this.pageCount) {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;›&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;»&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;›&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;»&lt;/a&gt;&lt;/span&gt;';}strHtml += '&lt;/span&gt;&lt;br /&gt;';break;case 1 : //模式1 (10页缩略,首页,前页,后页,尾页)strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;';strHtml += '&lt;span class=&quot;number&quot;&gt;';if (prevPage &lt; 1) {strHtml += '&lt;span title=&quot;First Page&quot;&gt;«&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;‹&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;«&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;‹&lt;/a&gt;&lt;/span&gt;';}if (this.page % 10 ==0) {var startPage = this.page - 9;} else {var startPage = this.page - this.page % 10 + 1;}if (startPage &gt; 10) strHtml += '&lt;span title=&quot;Prev 10 Pages&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + (startPage - 1) + ');&quot;&gt;...&lt;/a&gt;&lt;/span&gt;';for (var i = startPage; i &lt; startPage + 10; i++) {if (i &gt; this.pageCount) break;if (i == this.page) {strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;[' + i + ']&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + i + ');&quot;&gt;[' + i + ']&lt;/a&gt;&lt;/span&gt;';}}if (this.pageCount &gt;= startPage + 10) strHtml += '&lt;span title=&quot;Next 10 Pages&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + (startPage + 10) + ');&quot;&gt;...&lt;/a&gt;&lt;/span&gt;';if (nextPage &gt; this.pageCount) {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;›&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;»&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;›&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;»&lt;/a&gt;&lt;/span&gt;';}strHtml += '&lt;/span&gt;&lt;br /&gt;';break;case 2 : //模式2 (前后缩略,页数,首页,前页,后页,尾页)strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;';strHtml += '&lt;span class=&quot;number&quot;&gt;';if (prevPage &lt; 1) {strHtml += '&lt;span title=&quot;First Page&quot;&gt;«&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;‹&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;«&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;‹&lt;/a&gt;&lt;/span&gt;';}if (this.page != 1) strHtml += '&lt;span title=&quot;Page 1&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;[1]&lt;/a&gt;&lt;/span&gt;';if (this.page &gt;= 5) strHtml += '&lt;span&gt;...&lt;/span&gt;';if (this.pageCount &gt; this.page + 2) {var endPage = this.page + 2;} else {var endPage = this.pageCount;}for (var i = this.page - 2; i &lt;= endPage; i++) {if (i &gt; 0) {if (i == this.page) {strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;[' + i + ']&lt;/span&gt;';} else {if (i != 1 &amp;&amp; i != this.pageCount) {strHtml += '&lt;span title=&quot;Page ' + i + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + i + ');&quot;&gt;[' + i + ']&lt;/a&gt;&lt;/span&gt;';}}}}if (this.page + 3 &lt; this.pageCount) strHtml += '&lt;span&gt;...&lt;/span&gt;';if (this.page != this.pageCount) strHtml += '&lt;span title=&quot;Page ' + this.pageCount + '&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;[' + this.pageCount + ']&lt;/a&gt;&lt;/span&gt;';if (nextPage &gt; this.pageCount) {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;›&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;»&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;›&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;»&lt;/a&gt;&lt;/span&gt;';}strHtml += '&lt;/span&gt;&lt;br /&gt;';break;case 3 : //模式3 (箭头样式,首页,前页,后页,尾页) (only IE)strHtml += '&lt;span class=&quot;count&quot;&gt;Pages: ' + this.page + ' / ' + this.pageCount + '&lt;/span&gt;';strHtml += '&lt;span class=&quot;arrow&quot;&gt;';if (prevPage &lt; 1) {strHtml += '&lt;span title=&quot;First Page&quot;&gt;9&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;7&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;First Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(1);&quot;&gt;9&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Prev Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + prevPage + ');&quot;&gt;7&lt;/a&gt;&lt;/span&gt;';}if (nextPage &gt; this.pageCount) {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;8&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;:&lt;/span&gt;';} else {strHtml += '&lt;span title=&quot;Next Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + nextPage + ');&quot;&gt;8&lt;/a&gt;&lt;/span&gt;';strHtml += '&lt;span title=&quot;Last Page&quot;&gt;&lt;a href=&quot;javascript:' + this.name + '.toPage(' + this.pageCount + ');&quot;&gt;:&lt;/a&gt;&lt;/span&gt;';}strHtml += '&lt;/span&gt;&lt;br /&gt;';break;case 4 : //模式4 (下拉框)if (this.pageCount &lt; 1) {strHtml += '&lt;select name=&quot;toPage&quot; disabled&gt;';strHtml += '&lt;option value=&quot;0&quot;&gt;No Pages&lt;/option&gt;';} else {var chkSelect;strHtml += '&lt;select name=&quot;toPage&quot; onchange=&quot;' + this.name + '.toPage(this);&quot;&gt;';for (var i = 1; i &lt;= this.pageCount; i++) {if (this.page == i) chkSelect=' selected=&quot;selected&quot;';else chkSelect='';strHtml += '&lt;option value=&quot;' + i + '&quot;' + chkSelect + '&gt;Pages: ' + i + ' / ' + this.pageCount + '&lt;/option&gt;';}}strHtml += '&lt;/select&gt;';break;case 5 : //模式5 (输入框)strHtml += '&lt;span class=&quot;input&quot;&gt;';if (this.pageCount &lt; 1) {strHtml += '&lt;input type=&quot;text&quot; name=&quot;toPage&quot; value=&quot;No Pages&quot; class=&quot;itext&quot; disabled=&quot;disabled&quot;&gt;';strHtml += '&lt;input type=&quot;button&quot; name=&quot;go&quot; value=&quot;GO&quot; class=&quot;ibutton&quot; disabled=&quot;disabled&quot;&gt;&lt;/option&gt;';} else {strHtml += '&lt;input type=&quot;text&quot; value=&quot;Input Page:&quot; class=&quot;ititle&quot; readonly=&quot;readonly&quot;&gt;';strHtml += '&lt;input type=&quot;text&quot; id=&quot;pageInput' + this.showTimes + '&quot; value=&quot;' + this.page + '&quot; class=&quot;itext&quot; title=&quot;Input page&quot; onkeypress=&quot;return ' + this.name + '.formatInputPage(event);&quot; onfocus=&quot;this.select()&quot;&gt;';strHtml += '&lt;input type=&quot;text&quot; value=&quot; / ' + this.pageCount + '&quot; class=&quot;icount&quot; readonly=&quot;readonly&quot;&gt;';strHtml += '&lt;input type=&quot;button&quot; name=&quot;go&quot; value=&quot;GO&quot; class=&quot;ibutton&quot; onclick=&quot;' + this.name + '.toPage(document.getElementById(\'pageInput' + this.showTimes + '\').value);&quot;&gt;&lt;/option&gt;';}strHtml += '&lt;/span&gt;';break;default :strHtml = 'Javascript showPage Error: not find mode ' + mode;break;}return strHtml;}showPages.prototype.createUrl = function (page) { //生成页面跳转urlif (isNaN(parseInt(page))) page = 1;if (page &lt; 1) page = 1;if (page &gt; this.pageCount) page = this.pageCount;var url = location.protocol + '//' + location.host + location.pathname;var args = location.search;var reg = new RegExp('([\?&amp;]?)' + this.argName + '=[^&amp;]*[&amp;$]?', 'gi');args = args.replace(reg,'$1');if (args == '' || args == null) {args += '?' + this.argName + '=' + page;} else if (args.substr(args.length - 1,1) == '?' || args.substr(args.length - 1,1) == '&amp;') {args += this.argName + '=' + page;} else {args += '&amp;' + this.argName + '=' + page;}return url + args;}showPages.prototype.toPage = function(page){ //页面跳转var turnTo = 1;if (typeof(page) == 'object') {turnTo = page.options[page.selectedIndex].value;} else {turnTo = page;}self.location.href = this.createUrl(turnTo);}showPages.prototype.printHtml = function(mode){ //显示html代码this.getPage();this.checkPages();this.showTimes += 1;document.write('&lt;div id=&quot;pages_' + this.name + '_' + this.showTimes + '&quot; class=&quot;pages&quot;&gt;&lt;/div&gt;');document.getElementById('pages_' + this.name + '_' + this.showTimes).innerHTML = this.createHtml(mode);}showPages.prototype.formatInputPage = function(e){ //限定输入页数格式var ie = navigator.appName==&quot;Microsoft Internet Explorer&quot;?true:false;if(!ie) var key = e.which;else var key = event.keyCode;if (key == 8 || key == 46 || (key &gt;= 48 &amp;&amp; key &lt;= 57)) return true;return false;}//--&gt;&lt;/script&gt;&lt;style&gt;/* Pages Main Tyle */.pages {color: #000000;cursor: default;font-size: 10px;font-family: Tahoma, Verdana;padding: 3px 0px 3px 0px;}.pages .count, .pages .number, .pages .arrow {color: #000000;font-size: 10px;background-color: #F7F7F7;border: 1px solid #CCCCCC;}/* Page and PageCount Style */.pages .count {font-weight: bold;border-right: none;padding: 2px 10px 1px 10px;}/* Mode 0,1,2 Style (Number) */.pages .number {font-weight: normal;padding: 2px 10px 1px 10px;}.pages .number a, .pages .number span {font-size: 10px;}.pages .number span {color: #999999;margin: 0px 3px 0px 3px;}.pages .number a {color: #000000;text-decoration: none;}.pages .number a:hover {color: #0000ff;}/* Mode 3 Style (Arrow) */.pages .arrow {font-weight: normal;padding: 0px 5px 0px 5px;}.pages .arrow a, .pages .arrow span {font-size: 10px;font-family: Webdings;}.pages .arrow span {color: #999999;margin: 0px 5px 0px 5px;}.pages .arrow a {color: #000000;text-decoration: none;}.pages .arrow a:hover {color: #0000ff;}/* Mode 4 Style (Select) */.pages select, .pages input {color: #000000;font-size: 10px;font-family: Tahoma, Verdana;}/* Mode 5 Style (Input) */.pages .input input.ititle, .pages .input input.itext, .pages .input input.icount {color: #666666;font-weight: bold;background-color: #F7F7F7;border: 1px solid #CCCCCC;}.pages .input input.ititle {width: 70px;text-align: right;border-right: none;}.pages .input input.itext {width: 25px;color: #000000;text-align: right;border-left: none;border-right: none;}.pages .input input.icount {width: 35px;text-align: left;border-left: none;}.pages .input input.ibutton {height: 17px;color: #FFFFFF;font-weight: bold;font-family: Verdana;background-color: #999999;border: 1px solid #666666;padding: 0px 0px 2px 1px;margin-left: 2px;cursor: hand;}/* body */body {font-size: 12px;}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;script language=&quot;JavaScript&quot;&gt;&lt;!--var pg = new showPages('pg');pg.pageCount =12; // 定义总页数(必要)//pg.argName = 'p'; // 定义参数名(可选,默认为page)document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood Default');pg.printHtml();document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 0');pg.printHtml(0);document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 1');pg.printHtml(1);document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 2');pg.printHtml(2);document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 3 (only IE)');pg.printHtml(3);document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 4');pg.printHtml(4);document.write('&lt;br&gt;Show Times: ' + pg.showTimes + ', Mood 5');pg.printHtml(5);//--&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;</textarea>
提示:您可以先修改部分代码再运行


九 DIV的透明层实现

提示:您可以先修改部分代码再运行


十 JSP页面自动生成html页面/或任何格式页面
先建立一个模本页面:template.htm
<html>

<head>
<title>###title###</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css.css" rel=stylesheet type=text/css>
</head>

<body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td align="center">###title###</td>

</tr>
<tr>
<td align="center">作者:###author###&nbsp;&nbsp;</td>

</tr>
<tr>
<td>###content###
</td>


</tr>

</table>
</body>
</html>

=========================================
再写一个JSP页面: buildhtml.jsp

<%@ page contentType="text/html; charset=gb2312"import="java.util.*,java.io.*"%>
<%
try{
String title
="李鹏的jsp生成静态html文件"
;
String content
="小样,还搞不定你?"
;
String editer
="hpsoft"
;
String filePath
= ""
;
filePath
= request.getRealPath("/")+"template.htm"
;
out.print(filePath);
String templateContent
=""
;
FileInputStream fileinputstream
= new FileInputStream(filePath);//读取模块文件

int lenght = fileinputstream.available();
byte bytes[]= newbyte
[lenght];
fileinputstream.read(bytes);
fileinputstream.close();
templateContent
= new
String(bytes);
out.print(templateContent);
templateContent
=templateContent.replaceAll("###title###"
,title);
templateContent
=templateContent.replaceAll("###content###"
,content);
templateContent
=templateContent.replaceAll("###author###",editer);//替换掉模块中相应的地方

out.print(templateContent);
// 根据时间得文件名

Calendar calendar= Calendar.getInstance();
String fileame
= String.valueOf(calendar.getTimeInMillis())+".html"
;
fileame
= request.getRealPath("/")+fileame;//生成的html文件保存路径

FileOutputStream fileoutputstream= new FileOutputStream(fileame);//建立文件输出流
out.print("文件输出路径:<br>");
out.print(fileame);
byte tag_bytes[]=
templateContent.getBytes();
fileoutputstream.write(tag_bytes);
fileoutputstream.close();
}

catch(Exception e){
out.print(e.toString());
}


%>


十一 超级强大的表单验证

提示:您可以先修改部分代码再运行


十二 漂亮的脚本日历

提示:您可以先修改部分代码再运行

十三 进入,退出页面的各种效果!

进入页面<meta http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)">
推出页面<meta http-equiv="Page-Exit" content="revealTrans(duration=x, transition=y)">
这个是页面被载入和调出时的一些特效。duration表示特效的持续时间,以秒为单位。transition表示使用哪种特效,取值为1-23:
  0 矩形缩小
  1 矩形扩大
  2 圆形缩小
  3 圆形扩大
  4 下到上刷新
  5 上到下刷新
  6 左到右刷新
  7 右到左刷新
  8 竖百叶窗
  9 横百叶窗
  10 错位横百叶窗
  11 错位竖百叶窗
  12 点扩散
  13 左右到中间刷新
  14 中间到左右刷新
  15 中间到上下
  16 上下到中间
  17 右下到左上
  18 右上到左下
  19 左上到右下
  20 左下到右上
  21 横条
  22 竖条
  23 以上22种随机选择一种

十四 很酷的效果,表格被选中回变颜色

提示:您可以先修改部分代码再运行

十五 弹出提示的效果
<textarea rows="12" cols="95" name="runcode11">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;head&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;&lt;title&gt;cao888---提示&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;script language=javascript&gt;var cao_x,cao_y;function cao888(){this.display=display;}function display(){document.write(&quot;&lt;table align=center&gt;&lt;tr&gt;&lt;td&gt;&lt;button style='width:100px;height:30px;font-size:12px;border:1px solid #A4B3C8;background-color:green;' type=button onclick=document.getElementById('cao1').style.display='block' onfocus=this.blur()&gt;CAO留言&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;);document.write(&quot;&lt;div id='cao1' style='font-size:12px;position:absolute;display:none;text-align:center;overflow:visible'&gt;&quot;);document.write(&quot;&lt;div style='position:absolute;top:expression((body.clientHeight-300)/2);left:expression((body.clientWidth-200)/2);width:200px;height:180px;background-color:#dbdbdb;border:1px solid #cccccc;'&gt;&quot;);document.write(&quot;&lt;table width=200 height=20 bgcolor=green onmousedown='cao_x=event.x-parentNode.style.pixelLeft;cao_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='caoMove(this.parentNode)' style='cursor:move;'&gt;&quot;);document.write(&quot;&lt;tr align=center&gt;&quot;);document.write(&quot;&lt;td align=left&gt;提示:CAO888&lt;/td&gt;&quot;);document.write(&quot;&lt;/tr&gt;&quot;);document.write(&quot;&lt;/table&gt;&quot;);document.write(&quot;&lt;span style= cursor:hand onclick=this.parentNode.parentNode.style.display='none';&gt;&lt;img src='http://pic1.blueidea.com/bbs/topic5.gif'&gt;&lt;br&gt;CAO呀,错误了...&lt;br&gt;[确定]&lt;/span&gt;&quot;);document.write(&quot; &lt;/div&gt;&quot;);document.write(&quot;&lt;/div&gt;&quot;);}function caoMove(obj) //实现层的拖移{if(event.button==1){var caoX=obj.clientLeft;var caoY=obj.clientTop;obj.style.pixelLeft=caoX+(event.x-cao_x);obj.style.pixelTop=caoY+(event.y-cao_y);}}&lt;/script&gt;&lt;script language=javascript&gt;var mycao=new cao888();mycao.display();&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;</textarea>
提示:您可以先修改部分代码再运行

十六 图片之间的切换

提示:您可以先修改部分代码再运行



十七 DIV_圆边圆角的实现

提示:您可以先修改部分代码再运行


十八 跳动的菜单

提示:您可以先修改部分代码再运行



十九 通过页面抓取照片

提示:您可以先修改部分代码再运行


二十 客户端静态页面玩分页

提示:您可以先修改部分代码再运行

二十一 类似与google个性页面的好东东------网友155120

提示:您可以先修改部分代码再运行

二十二 漂亮的表格

提示:您可以先修改部分代码再运行


二十三 经典的带阴影的可拖动的浮动层--转贴自网友:marvellous

提示:您可以先修改部分代码再运行


二十四 运行代码的代码------网友:Lenvo


提示:您可以先修改部分代码再运行

二十五 凹陷文字------------网友:Lenvo

提示:您可以先修改部分代码再运行

二十六 漂亮的仿flash菜单---网友:Lenvo

提示:您可以先修改部分代码再运行

二十七 自定义容器和字体大小---网友:greengnn

提示:您可以先修改部分代码再运行

二十八 超级REAL视频播放器---网友:leaf52

提示:您可以先修改部分代码再运行


二十九 网站论坛上面快捷键提交表单的方法---网友:greengnn

提示:您可以先修改部分代码再运行
三 十 accesskey 提交---网友:greengnn


提示:您可以先修改部分代码再运行
对于快捷键的使用IE:ALT+快捷键



三十一 新闻广告图片切换效果+描述---网友:greengnn



提示:您可以先修改部分代码再运行

三十二 菜单特效---网友:greengnn



提示:您可以先修改部分代码再运行

三十三 采用CSS和JS的下拉菜单---网友:greengnn
\

提示:您可以先修改部分代码再运行


提示:您可以先修改部分代码再运行

网易娱乐头图新闻代码



提示:您可以先修改部分代码再运行

仿淘宝首页产品展示橱窗



提示:您可以先修改部分代码再运行



三十四 一个漂亮的菜单---网友:chyf1982
三十五 滚屏显示---网友:33o3
滚屏显示

将下面的代码插入到<body> </body>之间。
<script language"javascript">
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",10);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
</script>


滚动的按钮

<script Language="JavaScript">
function scrollit(){
for (I=1; I<=500; I++){
parent.scroll(1,I)
}
}
</script>
<form>
<div align="center"><center><p><input type="button" value=">>>开始向下滚屏<<<" onClick="scrollit()"> </p>
</center></div>
</form>

三十六 制作特殊字的脚本
制作特殊字的脚本

提示:您可以先修改部分代码再运行

三十七 美化列表
美化列表

提示:您可以先修改部分代码再运行



三十八 CSS模仿IE警告信息栏---网友:独来读网
CSS模仿IE警告信息栏

提示:您可以先修改部分代码再运行




三十九 文字幻灯片---网友:独来读网
文字幻灯片

提示:您可以先修改部分代码再运行


四 十 一个非常不错的loading 效果---网友:sungla
一个非常不错的loading 效果.借花献佛.

提示:您可以先修改部分代码再运行


四十一 文字滚动---网友:powerzl
文字滚动

提示:您可以先修改部分代码再运行


四十二 可拖动窗口,附带鼠标控制渐变透明---网友:lionhoho
可拖动窗口,附带鼠标控制渐变透明,开启关闭功能

提示:您可以先修改部分代码再运行



四十三 繁简体文字转换工具---网友:newlethe
繁简体文字转换工具

提示:您可以先修改部分代码再运行



四十四 收集整理的四个方向的滚动---网友:newlethe
收集整理的四个方向的滚动


向上滚动

提示:您可以先修改部分代码再运行
向下滚动

提示:您可以先修改部分代码再运行
向左滚动

提示:您可以先修改部分代码再运行
向右滚动

提示:您可以先修改部分代码再运行



四十五 将HTML自动转为JS代码---网友:liaoyizhi520
四十五 将HTML自动转为JS代码

提示:您可以先修改部分代码再运行


四十六 锁定表列---网友:liaoyizhi520

提示:您可以先修改部分代码再运行


四十七 滚动的图片---网友:z3333426


提示:您可以先修改部分代码再运行


四十八 放大镜特效---网友:thw416

提示:您可以先修改部分代码再运行


四十九 无名,感觉像黑克帝国---网友:cnbohu


提示:您可以先修改部分代码再运行

五 十 美丽的菜单---网友:9999999999999


提示:您可以先修改部分代码再运行




五十一 没有控制拦的REALL播放器---网友:9999999999999
没有控制拦的 REALL 播放器:

提示:您可以先修改部分代码再运行


五十二 荧光效果---网友:9999999999999


提示:您可以先修改部分代码再运行



五十三 滚动效果---网友:wuleying
滚动效果

提示:您可以先修改部分代码再运行



五十四 用层模拟可移动的小窗口---网友:goodrose
用层模拟可移动的小窗口

我来个:用层模拟可移动的小窗口``` 可用于网站的提示信息哦

提示:您可以先修改部分代码再运行



五十五 小方块---网友:leobluewing

提示:您可以先修改部分代码再运行



获得文本框的文件名

提示:您可以先修改部分代码再运行

漂浮的图片 遇到边界反弹

如果前面有朋友已经发了的话 我就换个了``

提示:您可以先修改部分代码再运行

一个模仿图片透明渐变做的表格颜色渐变效果

一个模仿图片透明渐变做的表格颜色渐变效果,从感观和过渡效果来讲都非常好,灵活运用一定增色不少!



五十五 文字包围图片的效果


提示:您可以先修改部分代码再运行


五十六 无图片实现圆角框

提示:您可以先修改部分代码再运行


五十七 图片预加载的使用

<script language="JavaScript" type="text/JavaScript">
<!--
function loadImages() {
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=loadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<body onLoad="loadImages('bus.gif','busline2.gif','1.gif','2.gif','3.gif','4.gif','5.gif')">
<img onmouseover="this.src='2.gif'" onmouseout="this.src='1.gif'" border="0" src="1.gif"></a>

五十八 数字选中放大
五十八 数字选中放大

提示:您可以先修改部分代码再运行


五十九 很帅的一个效果
五十九 很帅的一个效果

提示:您可以先修改部分代码再运行



六十 文本编辑器

提示:您可以先修改部分代码再运行


六十一 JSP页面不缓存


<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setHeader("Expires","0");
%>

六十二 图片淡如淡出

<textarea rows="12" cols="95" name="runcode16">&lt;script language=&quot;JavaScript&quot;&gt;nereidFadeObjects = new Object();nereidFadeTimers = new Object();function nereidFade(object, destOp, rate, delta){if (!document.all)returnif (object != &quot;[object]&quot;){ //do this so I can take a string toosetTimeout(&quot;nereidFade(&quot;+object+&quot;,&quot;+destOp+&quot;,&quot;+rate+&quot;,&quot;+delta+&quot;)&quot;,0);return;}clearTimeout(nereidFadeTimers[object.sourceIndex]);diff = destOp-object.filters.alpha.opacity;direction = 1;if (object.filters.alpha.opacity &gt; destOp){direction = -1;}delta=Math.min(direction*diff,delta);object.filters.alpha.opacity+=direction*delta;if (object.filters.alpha.opacity != destOp){nereidFadeObjects[object.sourceIndex]=object;nereidFadeTimers[object.sourceIndex]=setTimeout(&quot;nereidFade(nereidFadeObjects[&quot;+object.sourceIndex+&quot;],&quot;+destOp+&quot;,&quot;+rate+&quot;,&quot;+delta+&quot;)&quot;,rate);}}&lt;/script&gt;&lt;center&gt;&lt;a href=&quot;http://www.wawaqin.com&quot; onFocus=&quot;if(this.blur)this.blur()&quot;&gt;&lt;img src=&quot;http://www.wawaqin.com/images/xuyuanshu/wwq%20(448).jpg&quot; onMouseOut=nereidFade(this,100,10,3) onMouseOver=nereidFade(this,20,10,3) style=&quot;FILTER: alpha(opacity=100)&quot; border=&quot;0&quot; &gt;鼠标放到图片上&lt;/a&gt;</textarea>
提示:您可以先修改部分代码再运行

六十三 给图片添加图片的倒影


提示:您可以先修改部分代码再运行



六十四 取得页面的大小 宽高等各种信息


提示:您可以先修改部分代码再运行

六十五 漂亮的表格

提示:您可以先修改部分代码再运行

六十六 透明的Div提示

提示:您可以先修改部分代码再运行


六十七 来访统计

提示:您可以先修改部分代码再运行


六十八 地震效果---网友:zjewfq
<script language="JavaScript">
function surfto(form) {
var myindex=
form.select1.selectedIndex
if (form.select1.options[myindex].value !=null)
{
parent.main.location.href
=
form.select1.options[myindex].value;
}
}

</script>//这段JS代码意为当前页面的浏览器地震//
<script language="JavaScript1.2">
function shake(n) {
if (window.top.moveBy)
{
for (i = 10; i >0; i--)
{
for (j = n; j > 0; j--)
{
window.top.moveBy(
0
,i);
window.top.moveBy(i,
0
);
window.top.moveBy(
0,-
i);
window.top.moveBy(
-i,0
);
}
}
}

alert(
"呀~~地震啦!没~~吓坏吧?^_*");//这里设定地震后弹出的嬉戏性文字(据需随意)//
}

</script>
<script language="JavaScript">
function moyamoya(htmlfile) {
parent.main.location.href
=htmlfile;}

</script>

六十九 Firefox的加入收藏代码---网友:MKDuse [^_^]

提示:您可以先修改部分代码再运行

七 十 双击鼠标滚动屏幕的代码---网友:anyforever


提示:您可以先修改部分代码再运行

七十一 隐藏Div入门---网友:anyforever


提示:您可以先修改部分代码再运行

七十二 页面顶部颜色渐变特效---网友:utem123
页面顶部颜色渐变特效,不过只适合IE浏览器

提示:您可以先修改部分代码再运行


七十三 图片渐变切换---网友:utem123
图片渐变切换,缺点:不能显示需要切换的文件列表,希望有人可以修改一下,增加文件列表显示功能。

提示:您可以先修改部分代码再运行


七十四 对联广告---网友:virusG
很不错的对联广告!我一直用的

提示:您可以先修改部分代码再运行

七十五 旋转变换文字---网友:junly0626



提示:您可以先修改部分代码再运行
七十六 逐个出现的文字---网友:junly0626


提示:您可以先修改部分代码再运行

七十七 炽热的文字---网友:junly0626

提示:您可以先修改部分代码再运行