网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.在ASP中使用智岛网格控件全过程.
.较长数据无法在Asp页面中取出的三.
.如何在主页中控制浏览权限.
.ADO.NET:ADODataReader类.
.提高IIS的安全性.
.ASP程序密码验证问题 (MS,缺陷).
.ASP和C#隐藏文件下载路径的方法.
.不刷新页面筛选数据库中的数据.
.如何准确定时运行ASP文件.
.浅谈无刷新取得远程数据技术.
.在多行文本框中显示读取信息.
.用VB生成DLL封装ASP代码,连接数.
.避免asp的SQL的执行效率低.
.不能ASP图像组件来生成图像的ASP.
.转换文本为超联和Email格式的代码.
.PRB:ASP 返回“Operation Must .
.ASP实现可显示和隐藏的树型菜单.
.测字符串长度函数.
.ASP中用Join和Array,可以加快字.
.跨站Script攻击(一).

用鼠标控制滚动的菜单条!(JavaScript)

发表日期:2000-10-27


第一步,将下面的代码加<head>与</head>之间

<style>
body{background-color:#FFFFFF}
A{color:Navy; text-decoration:none}
A:hover{color:red}
A:visited:{color:#808080}
TD{font-family:arial,helvetica; font-size:10pt}
#divBg{position:absolute; z-index:10; width:200; left:0; height:100; clip:rect(0,10,10,0)}
#divMenu{position:absolute; left:15; top:6; font-weight:bold}
#divArrowLeft{position:absolute; width:20; height:20; left:0; top:9}
#divArrowRight{position:absolute; width:20; height:20; top:9}
</style><script>

//Simple browsercheck
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;

//The height of the menu
menuHeight=22

//Width of the arrows
arrowWidth=16

//Scroll speed: (in milliseconds, change this one and the next variable to change the speed)
scrollSpeed=20

//Pixels to scroll per timeout.
scrollPx=10

/**************************************************************************
Scrolling functions
***************************************************************************/
var tim;
var noScroll=true
function mLeft(){
if(!noScroll && oMenu.x<arrowWidth){
oMenu.moveBy(scrollPx,0)
tim=setTimeout("mLeft()",scrollSpeed)
}
}
function mRight(){
if(!noScroll && oMenu.x>-(oMenu.scrollWidth-(pageWidth))-arrowWidth){
oMenu.moveBy(-scrollPx,0)
tim=setTimeout("mRight()",scrollSpeed)
}
}
function noMove(){clearTimeout(tim); noScroll=true}
/**************************************************************************
Object part
***************************************************************************/
function makeObj(obj,nest,num){
nest=(!nest) ? '':'document.'+nest+'.'

this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')
this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);
this.scrollWidth=n?this.css.document.width:this.evnt.offsetWidth
this.x=(n)? this.css.left:this.evnt.offsetLeft; this.y=(n)?
this.css.top:this.evnt.offsetTop;
this.moveBy=b_moveBy; this.moveIt=b_moveIt; this.showIt=b_showIt;this.clipTo=b_clipTo;
return this
}
function b_moveBy(x,y){this.x=this.x+x; this.y=this.y+y; this.css.left=this.x; this.css.top=this.y}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
function b_clipTo(t,r,b,l){
if(n){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l
}else this.css.clip="rect("+t+","+r+","+b+","+l+")";
}
function b_showIt(){this.css.visibility="visible"}
/**************************************************************************
Object part end
***************************************************************************/

/**************************************************************************
Init function. Set the placements of the objects here.
***************************************************************************/
function side_init(){
//Width of the menu, Currently set to the width of the document.
//If you want the menu to be 500px wide for instance, just
//set the the pageWidth=500 in stead.
pageWidth=(n)?innerWidth:document.body.offsetWidth-20;

oBg=new makeObj('divBg')
oMenu=new makeObj('divMenu','divBg')
oArrowRight=new makeObj('divArrowRight','divBg')
//Placement
oBg.moveIt(0,0) //Main div, holds all the other divs.
oMenu.moveIt(arrowWidth,6)
oArrowRight.moveIt(pageWidth-arrowWidth,9)
//setting the width and the visible area of the links.
if(ie){ oBg.css.width=pageWidth; oBg.css.overflow="hidden"}
oBg.clipTo(0,pageWidth,menuHeight,0)
}

//executing the init function on pageload.
onload=side_init;
</script>

第二步:将下面的原代码加入<body>与</body>之间

<div id="divBg">
<div id="divMenu">
<table><tr><td nowrap>
[<a href="#">link 1</a>] ? [<a href="#">link
2</a>] ? [<a href="#">link 3</a>] ? [<a href="#">link
4</a>] ? [<a href="#">link 5</a>] ?
[<a href="#">link 6</a>] ?
[<a href="#">link 7</a>] ?
[<a href="#">link 8</a>] ?
[<a href="#">link 9</a>] ?
[<a href="#">link 10</a>] ?
[<a href="#">link 11</a>] ?
[<a href="#">link 12</a>] ?
[<a href="#">link 13</a>] ?
[<a href="#">link 14</a>] ?
[<a href="#">link 15</a>] ?
[<a href="#">link 16</a>] ?
[<a href="#">link 17</a>] ?
[<a href="#">link 18</a>] ?
[<a href="#">link 19</a>] ?
[<a href="#">link 20</a>] ?
[<a href="#">link 21</a>] ?
[<a href="#">link 22</a>] ?
[<a href="#">link 23</a>] ?
[<a href="#">link 24</a>] ?
[<a href="#">link 25</a>] ?
[<a href="#">link 26</a>] ?
[<a href="#">link 27</a>] ?
[<a href="#">link 28</a>] ?
[<a href="#">link 29</a>] ?
[<a href="#">link 30</a>]
</td></tr></table>
</div>

  <div id="divArrowLeft"><a href="javascript://" onmouseover="noScroll=false; mLeft()" onmouseout="noMove
()"><img src="images/013-r.gif" width=16 height=16 border=0></A></div>

  <div id="divArrowRight"><a href="javascript://" onmouseover="noScroll=false; mRight()" onmouseout="noMove
()"><img src="images/013-l.gif" width=16 height=16 border=0></a></div>
</div>
上一篇:页边距的设定技巧(HTML) 人气:11910
下一篇:ADO+管理器功能 人气:9199
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐