足球游戏_中国足彩网¥体育资讯$

通过html为FLASH加链接的实现代码(div层)
来源:易贤网 阅读:713 次 日期:2016-06-15 16:48:35
温馨提示:易贤网小编为您整理了“通过html为FLASH加链接的实现代码(div层)”,方便广大网友查阅!

今天有个客户要投放广告,给的素材是flash的,虽然我们不太喜欢,但没办法,客户就喜欢flash,怕一些浏览器或软件屏蔽flash自带的链接,需要我么通过html加一个链接,要不被阻止了效果不好。后果你懂的。

几年前帮别人维护的时候做过,后来好久不做了,感觉太生疏了,这里特别整理下,方便需要的朋友,希望大家多多支持脚本之家。

下面是完整的代码,因为flash文件都比较大我们特别用iframe加载了广告:

XML/HTML Code

1.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  

2.<html xmlns="http://www.w3.org/1999/xhtml">  

3.<head>  

4.<meta http-equiv="Content-Type" content="text/html; charset=gbk" />  

5.<title>flash加链接_脚本之家专用</title>  

6.<style type="text/css">  

7.<!--   

8.body {    

9.position:relative;    

10.z-index:0;    

11.margin:0; padding:0   

12.}    

13.body,td,th {   

14.    color: #333333;   

15.}   

16.*{margin:0; padding:0}   

17.img{ border:0}   

18.#jb51{ position:relative; width:300px; height:250px}   

19.#div1 {   

20.position:absolute;   

21.left:0;   

22.top:0;   

23.width:300px;    

24.height:250px; z-index:-1    

25.  

26.}    

27.#div2 {    

28.position:absolute;   

29.left:0;   

30.top:0;   

31.width:300px;    

32.height:250px;    

33.z-index:99999;    

34.}    

35.#div2 a:link{ display:block; width:300px; height:250px}   

36.-->  

37.</style></head>  

38.<body>  

39.<div id="jb51">  

40.<div id="div1">  

41.<script type="text/javascript">  

42.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="300" height="250">');   

43.document.write('<param name="movie" value="http://img.jb51.net/image/22cn_jb51net.swf" />');   

44.document.write('<param name="quality" value="high" /><param name="wmode" value="opaque" />');   

45.document.write('<embed src="http://img.jb51.net/image/22cn_jb51net.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="250" wmode="opaque"></embed>');   

46.document.write('</object>');   

47.</script>  

48.</div>  

49.<div id="div2">  

50.<a href="http://www.jb51.net" target="_blank"><img src="http://img.jb51.net/image/touming.png" width="300" height="250" /></a>  

51.</div>  

52.</div>  

53.</body>  

54.</html>  

现在广告管家都不好用了,百度管家停止其它物料,cnzz的被360屏蔽了,google的访问又慢。想进个后台也不容易。没办法只能放自己的服务器里了。

需要几点说明的:

<img src="http://img.jb51.net/image/touming.png" width="300" height="250" />这个里面的touming.png就是个1像素的透明png文件。不要图片的话ie下链接不对。

当然css样式是最重要的,先是position:relative,然后里面的才是position:absolute;

后来从网上看到别人提供的一个方法,通过button按钮实现的,就是不能新窗口打开。也顺便提供下吧。如果大家发现我们的这个也不好用希望能联系我们更新谢谢。

XML/HTML Code

1.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  

2.<html xmlns="http://www.w3.org/1999/xhtml">  

3.<head>  

4.<meta http-equiv="Content-Type" content="text/html; charset=gbk" />  

5.<title>无标题文档</title>  

6.<style type="text/css">  

7.<!--   

8.body {    

9.position:relative;    

10.z-index:0;    

11.margin:0; padding:0   

12.}    

13.body,td,th {   

14.    color: #333333;   

15.}   

16.*{margin:0; padding:0}   

17.img{ border:0}   

18.#jb51{ position:relative; width:300px; height:250px}   

19.#div1 {   

20.position:absolute;   

21.left:0;   

22.top:0;   

23.width:300px;    

24.height:250px; z-index:-1    

25.  

26.}    

27.#div2 {    

28.position:absolute;   

29.left:0;   

30.top:0;   

31.width:300px;    

32.height:250px;    

33.z-index:99999;    

34.}    

35.-->  

36.</style>  

37.</head>  

38.<body>  

39.<button style="width:300;height:250;background:transparent;border:o;padding:0;cursor:hand" onclick="window.location.href='http://s.jb51.net'">    

40.<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"     

41.        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="100%">    

42.             <param name="movie" value="http://img.jb51.net/image/22cn_jb51net.swf">    

43.             <param name="quality" value="high">  

44.             <param name="wmode" value="opaque" />  

45.             <embed src="http://img.jb51.net/image/22cn_jb51net.swf" width="300" height="250" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" align="middle"  wmode="opaque">    

46.               </embed>    

47.            </object>    

48.</button>    

49.</body>  

50.</html>  

中国足彩网信息请查看网页制作
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 加入群交流 | 手机站点 | 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 足球游戏_中国足彩网¥体育资讯$ 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65317125(9:00—18:00) 获取招聘考试信息及咨询关注公众号:hfpxwx
咨询QQ:526150442(9:00—18:00)版权所有:易贤网
云南网警报警专用图标