您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > ASP >

动态按钮生成器(上)

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 20:05 点击:
很COOL的,大家一起来研究研究!
<html><head><meta http-equiv=Content-Type content="text/html; charset=gb2312"><script language="javascript">
<!--Hide
//timer
speed=10;//Array to make Objects
Imagi=new Array();//numbers of Link
no_of_images=0;currentImage=-1;function checkBrowser(){var bname=navigator.appName;var ver=parseInt(navigator.appVersion);if(bname=="Netscape"&&ver>=3||bname=="Microsoft Internet Explorer"&&ver>=4);else{alert(You need Netscape Navigator 3 and above or Microsoft Internet Explorer 4 and above)
}}checkBrowser();//The Image Object
function ImageObject(Name,OffSrcPro,OffSrc,OnSrcPro,OnSrc,Width,Height,Alt,Border,URL,LinkTarget){this.Name=Name;this.OffSrcPro=OffSrcPro;this.OffSrc=OffSrc;this.OnSrcPro=OnSrcPro;this.OnSrc=OnSrc;this.Width=Width;this.Height=Height;this.Alt=Alt;this.Border=Border;this.URL=URL;this.LinkTarget=LinkTarget;this.length=11;}function headerSelect(grut,grutv){if(grut.options[0].selected){grutv.value="";}else{for(var y=0;y<grut.length;y++){if(grut.options[y].selected){grutv.value="";grutv.value+=grut.options[y].text;}}}}//Function Performing Form Validation
function checkMe(Me){with(Me){SrcBox1.focus();SrcBox1.blur();SrcBox2.focus();SrcBox2.blur();if(URLBox.value=="http://"||URLBox.value==""){alert("连接的URL没有设置");
URLBox.focus();
return false;
}if(SrcBox1.value==""){alert("MouseOut图片尚未设置");
SrcBox1.focus();
return false;
}if(SrcBox2.value==""){
alert("MouseOver图片尚未设置");
SrcBox2.focus();
return false;
}
if(NameBox.value==""){
alert("图片尚未命名");
NameBox.focus();
return false;
}
return true;}}
function checkAndShow(){
with(window.document.mouseOverForm.Images){if(options.length!=0){for(var i=0;i<options.length;i++){if(options[i].selected){with(window.document.mouseOverForm){URLBox.value=Imagi[i].URL;TargetBox.value=Imagi[i].LinkTarget;HeadSrc1.value=Imagi[i].OffSrcPro;HeadSrc2.value=Imagi[i].OnSrcPro;SrcBox1.value=Imagi[i].OffSrc;SrcBox2.value=Imagi[i].OnSrc;NameBox.value=Imagi[i].Name;BorderBox.value=Imagi[i].Border
AltBox.value=Imagi[i].Alt;WidthBox.value=Imagi[i].Width;HeightBox.value=Imagi[i].Height;currentImage=i;if(HeadSrc1.value=="file:///")
Header1.options[1].selected=true;else if(HeadSrc1.value=="http://")
Header1.options[2].selected=true;else if(HeadSrc1.value=="")
Header1.options[0].selected=true;if(HeadSrc2.value=="file:///")
Header2.options[1].selected=true;else if(HeadSrc2.value=="http://")
Header2.options[2].selected=true;else if(HeadSrc2.value=="")
Header2.options[0].selected=true;}}}}
}
}function insertItem(){with(window.document.mouseOverForm){if(checkMe(window.document.mouseOverForm)){Imagi[no_of_images]=new ImageObject(NameBox.value,HeadSrc1.value,SrcBox1.value,HeadSrc2.value,SrcBox2.value,WidthBox.value,HeightBox.value,AltBox.value,BorderBox.value,URLBox.value,TargetBox.value);Images.length+=1;Images.options[Images.length-1].text=Imagi[no_of_images].Name;++no_of_images;CleanBoxes(window.document.mouseOverForm);CleanBoxes(window.document.mouseOverForm);}}}//Clean options[0] when page loaded

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • WAP常见问题问答大全(四)
      • ASP开发必备:WEB打印代码大全
      • ASP调用系统ping命令
      • asp缓存技术
      • ASP教程:第三篇 ASP基础
      • 用ASP+XML打造留言本(4)
      • 关于ASP Recordset 分页出现负数解决方法及建议
      • 用asp怎样编写文档搜索页面(5)
      • ASP处理多关键词查询实例代码
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1