<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>图片随机飘动代码生成器</title> <style type="text/css"> body { text-align:center } table td { font-size:9pt; } </style> <script language="JavaS <!-- function fn_getValueRadio(form_name) { var value = ""; for (var i=0; i<form_name.length;i++) { if (form_name[i].checked) { value = form_name[i].value; break; } } return value; } function fn_display(form_name) { var display = fn_getValueRadio(form_name); if (display == "flash") { document.getElementById("image").style.display = "none" document.getElementById("imageUrl").style.display = "none" document.getElementById("flash").style.display = "" } else if (display == "image") { document.getElementById("image").style.display = "" document.getElementById("imageUrl").style.display = "" document.getElementById("flash").style.display = "none" } } function JM_cc(ob) { ob.select(); js=ob.createTextRange(); js.execCommand("Copy"); } function fn_createCode(form_name) { //生成飘动的层 var display = fn_getValueRadio(form_name.type); var div_html = ""; if (display == "image") { var imgPath = form_name.imgPath.value; var imgHeight = form_name.imgHeight.value; var imgWidth = form_name.imgWidth.value; var imgUrl = form_name.imgUrl.value; var mouse = fn_getValueRadio(form_name.mouse) if (imgPath == "") { alert("请输入飘动图片的路径") return; } if ((imgHeight == "")||((imgHeight != "")&&(!isNumber(imgHeight)))) { alert("图片的高度不能为空且只能为数字") return; } if ((imgWidth == "")||((imgWidth != "")&&(!isNumber(imgWidth)))) { alert("图片的宽度不能为空且只能为数字") return; } if (mouse == "1") { if (imgUrl != "") div_html += "<span id='img' style='position:absolute;' on else div_html += "<span id='img' style='position:absolute;' on } else { if (imgUrl != "") div_html += "<span id='img' style='position:absolute;'><a href='"+imgUrl+"' target='_blank'><img src='"+imgPath+"' width='"+imgHeight+"' height='"+imgWidth+"' border='0'> </a></span>" else div_html += "<span id='img' style='position:absolute;'><img src='"+imgPath+"' width='"+imgHeight+"' height='"+imgWidth+"'></span>" } } else if (display == "flash") { var fPath = form_name.fPath.value; var fHeight = form_name.fHeight.value; var fWidth = form_name.fWidth.value; var fmouse = fn_getValueRadio(form_name.mouse) if (fPath == "") { alert("请输入飘动flash的路径") return; } if ((fHeight == "")||((fHeight != "")&&(!isNumber(fHeight)))) { alert("flash的高度不能为空且只能为数字") return; } if ((fWidth == "")||((fWidth != "")&&(!isNumber(fWidth)))) { alert("flash的宽度不能为空且只能为数字") return; } if (fmouse == "1") { div_html += "<span id='img' style='position:absolute;' on div_html += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+fWidth+"' height='"+fHeight+"'>"; div_html += "<param name='movie' value='"+fPath+"'>"; div_html += "<param name='quality' value='high'>" div_html += "<embed src='"+fPath+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+fWidth+"' height='"+fHeight+"'></embed></object></span>"; } else { div_html += "<span id='img' style='position:absolute;'>"; div_html += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+fWidth+"' height='"+fHeight+"'>"; div_html += "<param name='movie' value='"+fPath+"'>"; div_html += "<param name='quality' value='high'>" div_html += "<embed src='"+fPath+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+fWidth+"' height='"+fHeight+"'></embed></object></span>"; } } //设置飘动参数生成飘动代码 var co var position = fn_getValueRadio(form_name.imgPosition); var xPos = 0; var yPos = 0; switch (position) { case "topLeft": xPos = 0; yPos = 0; break; case "topCenter": xPos = parseInt(document.body.clientWidth/2); yPos = 0; break; case "topRight": xPos = document.body.clientWidth; yPos = 0; break; case "bottomLeft": xPos = 0; yPos = document.body.clientHeight; break; case "bottomCenter": xPos = parseInt(document.body.clientWidth/2); yPos = document.body.clientHeight; break; case "bottomRight": xPos = document.body.clientWidth; yPos = document.body.clientHeight; break; } var delay_time = parseInt(fn_getValueRadio(form_name.delay)) var delay = 0; switch (delay_time) { case 5: delay = 5 break; case 10: delay = 10 break; case 20: delay = 20 break; case 30: delay =30 break; case 40: delay = 40 break; case 50: delay = 50 break; } co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co co form_name.co } function isNumber(value) { var desc = "0123456789"; for (var i = 0; i<value.length;i++) { if (desc.indexOf(value.charAt(i)) == -1) return false } return true; } --> </script> </head> <body topmargin="0"> <p><font size="4">图片flash随机飘动代码生成器 </font></p> <form name="createCode" method="post" act <table width="700" border="0" cellspacing="0" cellpadding="0" style="line-height:20px"> <tr> <td width="119"> </td> <td width="256"> </td> <td colspan="4"> </td> </tr> <tr> <td width="119" align="right">飘动元素:</td> <td width="256"><input name="type" type="radio" value="image" checked on 图片文件<input type="radio" name="type" value="flash" on flash文件 </td> <td colspan="4"> </td> </tr> <tr id="image" style="display:"> <td align="right" >图片路径:</td> <td align="center"> <input type="text" name="imgPath" style="width:250px"></td> <td width="60" align="right">图片高度</td> <td width="92" align="center"><input type="text" name="imgHeight" style="width:80px"></td> <td width="67" align="right">图片宽度</td> <td width="106" align="center"><input type="text" name="imgWidth" style="width:80px"></td> </tr> <tr id="flash" style="display:none"> <td align="right">flash路径:</td> <td align="center"> <input type="text" name="fPath" style="width:250px"></td> <td width="60" align="right">flash高度</td> <td width="92" align="center"><input type="text" name="fHeight" style="width:80px"></td> <td width="67" align="right">flash宽度</td> <td width="106" align="center"><input type="text" name="fWidth" style="width:80px"></td> </tr> <tr id="imageUrl" style="display:"> <td align="right">图片链接:</td> <td align="center"> <input type="text" name="imgUrl" style="width:250px"></td> <td colspan="4" align="right"> </td> </tr> <tr> <td height="16" align="right">图片首次出现位置:</td> <td colspan="5"><input name="imgPosition" type="radio" value="topLeft" checked> 上左 <input type="radio" name="imgPosition" value="topCenter"> 上中 <input type="radio" name="imgPosition" value="topRight"> 上右 <input type="radio" name="imgPosition" value="bottomLeft"> 下左 <input type="radio" name="imgPosition" value="bottomCenter"> 下中 <input type="radio" name="imgPosition" value="bottomRight"> 下右 </td> </tr> <tr> <td align="right">图片飘动延迟时间:</td> <td colspan="5"><input type="radio" name="delay" value="5"> 5ms <input name="delay" type="radio" value="10" checked> 10ms <input type="radio" name="delay" value="20"> 20ms <input type="radio" name="delay" value="30"> 30ms <input type="radio" name="delay" value="40"> 40ms <input type="radio" name="delay" value="50"> 50ms</td> </tr> <tr> <td align="right" valign="top">鼠标事件:</td> <td align="left" valign="top"><input name="mouse" type="radio" value="1" checked> 是 <input type="radio" name="mouse" value="0"> 否 </td> <td colspan="4" align="left" valign="top">鼠标事件说明:<br>当鼠标放在图片上时,图片飘动是否停止</td> </tr> <tr> <td align="right" valign="top"> </td> <td align="left" valign="top"><input type="button" name="Button" value="生成代码" on <td colspan="4" align="left" valign="top"> </td> </tr> </table> <table width="700" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="81"> </td> <td width="626"><textarea name="co <td width="71"> </td> </tr> <tr> <td> </td> <td><input type="button" name="Button" value="复制到剪切板" on <td> </td> </tr> <tr> <td> </td> <td>将文本框中生成的代码拷贝到您的页面</td> <td> </td> </tr> </table> </form> <p><font size="4"></font> </p> </body> </html> |
|