>
设为首页
>
收藏本站
>
最新电影
首页
运营资讯
今日英语
图形图像
计算机技术
Asp编程
网站结构化
资源共享
休闲娱乐
访问新站
您现在的位置:
首页
=>
后台技术
=>
脚本特效
=>
背景特效
订阅本栏目
滚动条调制并改变背景的特效
时间: 2007-10-03 07:15:23 阅读次数:2754
<html> <title>网页特效代码|www.ffasp.com 飞飞Asp乐园|---滚动条调制并改变背景的特效</title> <head> <STYLE type=text/css>BODY { MARGIN: 25px 25px 25px } #all TD { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体" } INPUT { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体" } SELECT { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体" } P { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体" } TEXTAREA { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体" } #all A:active { COLOR: #7d070c } #all A:visited { COLOR: #7d070c } #all A:hover { COLOR: #336699 } #all A:link { COLOR: #7d070c } </STYLE> <SCRIPT language=JavaScript> <!-- function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } function JM_cc(ob){ var obj=MM_findObj(ob); if (obj) { obj.select();js=obj.createTextRange();js.execCommand("Copy");} } function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x; } //--> </SCRIPT> <META content="Microsoft FrontPage 6.0" name=GENERATOR> <style>.drag { CURSOR: hand; POSITION: relative } </style> </HEAD> <BODY id=all text=#000000 bgColor=#336699> <table width="100%" border="0" cellpadding="8" height="124"> <tr> <td align="center" height="17"> </td> </tr> <tr> <td bgcolor="#f7f7f7" height="71"> <p> <script language=JavaScript1.2> // Slider script by Ronald H. Jankowsky (http://www.lovehy.com), parts of code (draglayer, movelayer) by DynamicDrive.com // This script is free for use, please leave this notice intact var sPosition; var showPerc=100; document.onmousedown=dragLayer document.onmouseup=new Function("dragMe=false") var Color= new Array(); Color[0] = "00"; Color[1] = "11"; Color[2] = "22"; Color[3] = "33"; Color[4] = "44"; Color[5] = "55"; Color[6] = "66"; Color[7] = "77"; Color[8] = "88"; Color[9] = "99"; Color[10] = "AA"; Color[11] = "BB"; Color[12] = "CC"; Color[13] = "DD"; Color[14] = "EE"; Color[15] = "FF"; // Demofunction to change bg-color by moving slider var rVal,gVal,bVal, cCol function chgBg() { cCol = document.bgColor; rVal=cCol.substr(1,2); gVal=cCol.substr(3,2); bVal=cCol.substr(5,2); ind = Math.round(showPerc/16); if (ind < 0) ind = 0; if (ind > 15) ind=15; // If more sliders are used, each of them has to be handled separately if (kObj.id =="knobImg") document.bgColor="#"+Color[ind]+gVal+bVal; if (kObj.id =="knobImg1") document.bgColor="#"+rVal+Color[ind]+bVal; if (kObj.id =="knobImg2") document.bgColor="#"+rVal+gVal+Color[ind]; } // Drag and move engine (original code by DynamicDrive.com), don't change unless explicitely indicated var dragMe=false, kObj, yPos,direction function moveLayer() { if (event.button==1 && dragMe) { oldY = kObj.style.pixelTop; kObj.style.pixelTop=temp2+event.clientY-yPos; // Limit movement of knob to stay inside layer if (kObj.style.pixelTop > oldY) direction="dn"; else direction="up"; if (kObj.style.pixelTop < 2 && direction=="up") {kObj.style.pixelTop=2; direction="dn";} if (kObj.style.pixelTop > 102 && direction=="dn") {kObj.style.pixelTop=102; direction="up";} // Set working variable 'showPerc' depending on 100 or 250 scaling sPosition=kObj.style.pixelTop; showPerc = (perCent[0].checked) ? sPosition-2 : (sPosition-2)/2*5; // The following line should be replaced by the function-call with the actual task to perform chgBg(); return false; } } function dragLayer() { if (!document.all) return; if (event.srcElement.className=="drag") {dragMe=true; kObj=event.srcElement; temp2=kObj.style.pixelTop; yPos=event.clientY; document.onmousemove=moveLayer; } } </script> 提示:这是一个颜色的调节器,现在本例子只简单的改变了背景的颜色,你完全可以将这使用方法应用到如聊天室的字体颜色等程序上,可以让你的应用增添色彩.<script language="JavaScript"> document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>"); </script><input type=radio value=false name=perCent> Prozent <input type=radio CHECKED value=true name=perCent> 255</p> <div id=outerLyr style="Z-INDEX: 1; LEFT: 233px; WIDTH: 23px; POSITION: absolute; TOP: 111px; HEIGHT: 120px; BACKGROUND-COLOR: #000000"><img class=drag id=knobImg style="Z-INDEX: 3; LEFT: 2px; WIDTH: 20px; TOP: 100px; HEIGHT: 17px" src="../tempimgs/js/knob.jpeg"> <div id=innerLyr style="Z-INDEX: 2; LEFT: 2px; WIDTH: 20px; POSITION: absolute; TOP: 2px; HEIGHT: 117px; BACKGROUND-COLOR: #777777"> <div id=barLyr style="Z-INDEX: 1; LEFT: 9px; WIDTH: 2px; POSITION: absolute; TOP: 5px; HEIGHT: 110px; BACKGROUND-COLOR: #000000"></div> </div> </div> <div id=outerLyr1 style="Z-INDEX: 1; LEFT: 268px; WIDTH: 23px; POSITION: absolute; TOP: 111px; HEIGHT: 120px; BACKGROUND-COLOR: #000000"><img class=drag id=knobImg1 style="Z-INDEX: 3; LEFT: 2px; WIDTH: 20px; TOP: 100px; HEIGHT: 17px" src="../tempimgs/js/knob.jpeg"> <div id=innerLyr1 style="Z-INDEX: 2; LEFT: 2px; WIDTH: 20px; POSITION: absolute; TOP: 2px; HEIGHT: 117px; BACKGROUND-COLOR: #777777"> <div id=barLyr1 style="Z-INDEX: 1; LEFT: 9px; WIDTH: 2px; POSITION: absolute; TOP: 5px; HEIGHT: 110px; BACKGROUND-COLOR: #000000"></div> </div> </div> <div id=outerLyr2 style="Z-INDEX: 1; LEFT: 300px; WIDTH: 23px; POSITION: absolute; TOP: 111px; HEIGHT: 120px; BACKGROUND-COLOR: #000000"><img class=drag id=knobImg2 style="Z-INDEX: 3; LEFT: 2px; WIDTH: 20px; TOP: 100px; HEIGHT: 17px" src="../tempimgs/js/knob.jpeg"> <div id=innerLyr2 style="Z-INDEX: 2; LEFT: 2px; WIDTH: 20px; POSITION: absolute; TOP: 2px; HEIGHT: 117px; BACKGROUND-COLOR: #777777"> <div id=barLyr2 style="Z-INDEX: 1; LEFT: 9px; WIDTH: 2px; POSITION: absolute; TOP: 5px; HEIGHT: 110px; BACKGROUND-COLOR: #000000"></div> </div> <!-- This would be a way to configure if slider range is 0-100 or 0-255 --> </div> </td> </tr> </table> </head> </html>
提示:您可以先修改部分代码再运行
飞飞Asp技术乐园
站内搜索
:
标题
内容
下一篇
点击图片从 改变网页背景图片
上一篇
背景斜向移动
本栏目最新
栏目最新列表
点击图片从 改变网页背景图片
滚动条调制并改变背景的特效
背景调色板
手动调节背景色
链接驱动背景色
网站优化策划
栏目最新列表
增加网站外链的快速方法
网站上线前必做的30个检查
新的友情链接参考标准(没有google的PR情况
优化Google的AdSense广告的五个工具
王通讲SEO八大基础
站点最新
站点最新列表
微博推广的一些技巧
xhEditor v1.1.7 发布,
收集的一些轻量级非常实
50个新鲜兼容最新版本的
javascript中cookie的设
Excel中出现#VALUE!、#D
jquery插件:飞飞表情插件
十个使用HTML5开发的精彩
支持HTML5的浏览器有哪些
飞妮莫属:漫画:如何写出
历史最热10条信息
AWStats安装QQ传真IP插件
MIME介绍 及
[
1
] [
2
] [
3
]
巧用Google和迅雷来下载
Transact SQL 常
[
1
] [
2
]
VIA Rhine II Fast Ethe
电脑常用端
[
1
] [
2
] [
3
]
Do you get a kick out
十道羊皮卷 欣赏+mp3版+
每日一句:A friend and
经典__悟透JavaScript
伟哥博客
西安房产
123最新电影
三四六四
关于站点
|
免责声明
|
联系站长
|
网站地图
|
陕ICP备07002804号
WEB技术QQ交流群:72840059
©2007 ffasp.com. 版权所有