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

动态按钮生成器(下)

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 05:58 点击:
由于内容超长,只好分2次贴出,以下为下半部分:
Images.length+=1;for(var b=Images.options.length-1;b>g;b--)
{Images.options[b].text=Images.options[b-1].text;}Images.options[g+1].text=Imagi[g+1].Name;CleanBoxes(window.document.mouseOverForm);}}}else
{if(Images.length!=0)
{var g=-1;var r=no_of_images;Imagi[r]=new ImageObject(Imagi[r-1].Name,Imagi[r-1].OffSrcPro,Imagi[r-1].OffSrc,Imagi[r-1].OnSrcPro,Imagi[r-1].OnSrc,Imagi[r-1].Width,Imagi[r-1].Height,Imagi[r-1].Alt,Imagi[r-1].Border,Imagi[r-1].URL,Imagi[r-1].LinkTarget);for(var p=Imagi.length-2;p>g;p--)
{Imagi[p].Name=Imagi[p-1].Name;Imagi[p].OffSrcPro=Imagi[p-1].OffSrcPro;Imagi[p].OffSrc=Imagi[p-1].OffSrc;Imagi[p].OnSrcPro=Imagi[p-1].OnSrcPro;Imagi[p].OnSrc=Imagi[p-1].OnSrc;Imagi[p].Width=Imagi[p-1].Width;Imagi[p].Height=Imagi[p-1].Height;Imagi[p].Alt=Imagi[p-1].Alt;Imagi[p].Border=Imagi[p-1].Border;Imagi[p].URL=Imagi[p-1].URL;Imagi[p].LinkTarget=Imagi[p-1].LinkTarget;}
Imagi[g+1].URL=URLBox.value;Imagi[g+1].LinkTarget=TargetBox.value;Imagi[g+1].Name=NameBox.value;Imagi[g+1].OffSrcPro=HeadSrc1.value;Imagi[g+1].OnSrcPro=HeadSrc2.value;Imagi[g+1].OffSrc=SrcBox1.value;Imagi[g+1].OnSrc=SrcBox2.value;Imagi[g+1].Width=WidthBox.value;Imagi[g+1].Height=HeightBox.value;Imagi[g+1].Alt=AltBox.value;Imagi[g+1].Border=BorderBox.value;no_of_images++;
Images.length+=1;for(var b=Images.options.length-1;b>g;b--)
{Images.options[b].text=Images.options[b-1].text;}Images.options[g+1].text=Imagi[g+1].Name;CleanBoxes(window.document.mouseOverForm);}else
alert("缺少项目!")
}}}function CheckIt(array,string){if(array==null||array=="")
variable="";else
variable=string+array+""";return variable;}function generateIt() {if (document.mouseOverForm.Images.length != 0) {HeadCode = "<SCRIPT LANGUAGE="Javascript">" + "<" + "!-" + "-Hide";HeadCode += "//http://www.njcatv.net/javascript/dai5.htm";HeadCode += "function isCompatible()" + "{" + "var BrowserName=navigator.appName;" + "var BrowserVer=parseInt(navigator.appVersion);" + "var Compatible=(BrowserName=="Netscape"&&BrowserVer==3)||(BrowserName=="Netscape"||BrowserVer==4)||(BrowserName=="Microsoft Internet Explorer"||BrowserVer==4)" + "return Compatible;" + "}";HeadCode += "function flipIt(img,tothis)" + "{" + "if(isCompatible())" + "{" + "img.src=tothis.src;" + "}" + "}";BodyCode = "";for (var count = 0; count < Imagi.length; count++) {var xName = Imagi[count].Name;var xNameOff = Imagi[count].OffSrcPro + Imagi[count].OffSrc;var xNameOn = Imagi[count].OnSrcPro + Imagi[count].OnSrc;var Target = CheckIt(Imagi[count].LinkTarget, "TARGET="");var Border=CheckIt(Imagi[count].Border," BORDER="");var Alt = CheckIt(Imagi[count].Alt, "ALT="\");var Width=CheckIt(Imagi[count].Width," WIDTH="");var Height = CheckIt(Imagi[count].Height, "HEIGHT="");var MouseOver="onMouseOver="flipIt(document." + xName + "," + xName + "On);"";
var MouseOut="onMouseOut="flipIt(document." + xName + "," + xName + "Off);"";
HeadCode+=xName+"Off = new Image();";HeadCode+=xName+"Off.src = "+""" + xNameOff + "";"+"";HeadCode+=xName+"On = new Image();";HeadCode+=xName+"On.src = "+""" + xNameOn + "";"+"";BodyCode+="<A HREF=""+ Imagi[count].URL + """+Target+" "+MouseOver+" "+MouseOut+"><IMG SRC="" + xNameOff + "" NAME="" + xName + """+Border+Alt+Width+Height+"></A>";}HeadCode+="/"+"/End Hide-"+"->";Emulate=window.open("","CodeWindow","width=640,height=420,status=yes,resizable=yes,scrollbars=yes");Emulate.document.clear();Emulate.document.write(<html><head><title>Code generated</title></head><body bgcolor="#ffffff" text="#000000" link="#000099" vlink="#663366" alink="#ff0000">);Emulate.document.write("<br><br><center><font face="宋体">如下代码拷贝到<font color="red">HEAD</font>标签间</font></center><form name="genCode"><center><textarea cols=55 rows=16 name="Head" wrap="Virtual"></textarea><p><font face="宋体">

    相关新闻>>

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

      推荐热点

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

      豫ICP备11007008号-1