标题 | 通过html为FLASH加链接的实现代码(div层) |
内容 | 今天有个客户要投放广告,给的素材是flash的,虽然我们不太喜欢,但没办法,客户就喜欢flash,怕一些浏览器或软件屏蔽flash自带的链接,需要我么通过html加一个链接,要不被阻止了效果不好。后果你懂的。 几年前帮别人维护的时候做过,后来好久不做了,感觉太生疏了,这里特别整理下,方便需要的朋友,希望大家多多支持脚本之家。 下面是完整的代码,因为flash文件都比较大我们特别用iframe加载了广告: XML/HTML Code复制内容到剪贴板 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>flash加链接_脚本之家专用</title> <style type="text/css"> <!-- body { position:relative; z-index:0; margin:0; padding:0 } body,td,th { color: #333333; } *{margin:0; padding:0} img{ border:0} #jb51{ position:relative; width:300px; height:250px} #div1 { position:absolute; left:0; top:0; width:300px; height:250px; z-index:-1 } #div2 { position:absolute; left:0; top:0; width:300px; height:250px; z-index:99999; } #div2 a:link{ display:block; width:300px; height:250px} --> </style></head> <body> <div id="jb51"> <div id="div1"> <script type="text/javascript"> document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="" width="300" height="250">'); document.write('<param name="movie" value="" />'); document.write('<param name="quality" value="high" /><param name="wmode" value="opaque" />'); document.write('<embed src="" quality="high" pluginspage="" type="application/x-shockwave-flash" width="300" height="250" wmode="opaque"></embed>'); document.write('</object>'); </script> </div> <div id="div2"> <a href="" target="_blank"><img src="" width="300" height="250" /></a> </div> </div> </body> </html> 现在广告管家都不好用了,百度管家停止其它物料,cnzz的被360屏蔽了,google的访问又慢。想进个后台也不容易。没办法只能放自己的服务器里了。 需要几点说明的: <img src="" width="300" height="250" />这个里面的touming.png就是个1像素的透明png文件。不要图片的话ie下链接不对。 当然css样式是最重要的,先是position:relative,然后里面的才是position:absolute; 后来从网上看到别人提供的一个方法,通过button按钮实现的,就是不能新窗口打开。也顺便提供下吧。如果大家发现我们的这个也不好用希望能联系我们更新谢谢。 XML/HTML Code复制内容到剪贴板 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> <!-- body { position:relative; z-index:0; margin:0; padding:0 } body,td,th { color: #333333; } *{margin:0; padding:0} img{ border:0} #jb51{ position:relative; width:300px; height:250px} #div1 { position:absolute; left:0; top:0; width:300px; height:250px; z-index:-1 } #div2 { position:absolute; left:0; top:0; width:300px; height:250px; z-index:99999; } --> </style> </head> <body> <button onclick="window.location.href='http://s.jb51.net'"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="" height="100%"> <param name="movie" value=""> <param name="quality" value="high"> <param name="wmode" value="opaque" /> <embed src="" width="300" height="250" quality="high" pluginspage="" type="application/x-shockwave-flash" wmode="opaque"> </embed> </object> </button> </body> </html> |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。