当前位置: 移动技术网 > IT编程>开发语言>.net > 动态按钮生成器(上)

动态按钮生成器(上)

2018年10月15日  | 移动技术网IT编程  | 我要评论

我们结婚了20110122,choizachoi,嘉禾县人民政府

很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=="https://"||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=="https://")
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=="https://")
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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网