动态按钮生成器(上)
来源:网络 责任编辑:栏目编辑 发表时间: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
<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
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>