通过html为FLASH加链接的实现代码(div层)

今天有个客户想投放广告,材料是flash是的,虽然我们不太喜欢,但客户不能喜欢flash害怕一些浏览器或软件屏蔽flash我需要自带链接通过html添加链接,否则会阻止效果不好。你知道后果。

几年前,我帮助别人维护它。后来,我很久没做了。我觉得太陌生了。这里有一个特别的安排,方便有需要的朋友。我希望你能支持脚本之家。

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

XML/HTML Code复制内容到剪贴板

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<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:http://www.qlyl1688.com/products/yyzsq.html: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="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="300" height="250">');   
document.write('<param name="movie" value="http://img.jb51.net/image/22cn_jb51net.swf" />');   
document.write('<param name="quality" value="high" /><param name="wmode" value="opaque" />');   
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>');   
document.write('</object>');   
</script>  
</div>  
<div id="div2">  
<a href="https://www.jb51.net" target="_blank"><img src="http://img.jb51.net/image/touming.png" width="300" height="250" /></a>  
</div>  
</div>  
</body>  
</html>  

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

需要几点说明的:

这个里面的touming.png就是个1像素的透明png文件。不要图片的话ie下链接不对。

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

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

XML/HTML Code复制内容到剪贴板

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<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 style="width:300;height:250;background:transparent;border:o;padding:0;cursor:hand" οnclick="window.location.href='http://s.jb51.net'">    
<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="100%" height="100%">    
             <param name="movie" value="http://img.jb51.net/image/22cn_jb51net.swf">    
             <param name="quality" value="high">  
             <param name="wmode" value="opaque" />  
             <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">    
               </embed>    
            </object>    
</button>    
</body>  
</html>  

以上是云南仟龙Mark给大家介绍的所有内容,希望对大家有所帮助,如果大家有任何疑问请在脚本之家留言,如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值