+ -
当前位置:首页 → 问答吧 → 仿百度新浪等流媒体flv随屏视频广告源码

仿百度新浪等流媒体flv随屏视频广告源码

时间:2009-08-05

来源:互联网


=700) window.open('http://images.phpfans.net/attach/images/20090805_da4e0ca3b7b6c20bfbae3wo9kY9w7UfG.jpg');" onload="if(this.offsetWidth>'700')this.width='700';if(this.offsetHeight>'700')this.height='700';" >

下面的压缩包是源代码需要的自己下 内附图片 flv播放器 演示等

代码如下:
<script language=\"javascript\" type=\"text/javascript\" src=\"images/videoad.js\"></script>

<DIV id=eMeng style=\" Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-BOTTOM: #000 2px solid; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: #000\">

<TABLE width=\"234\" height=\"160\" border=0 cellPadding=0 cellSpacing=0 bgColor=#000000 >

<TBODY>

<TR bgColor=#000>

<TD style=\"font-size: 12px; background-image: url('images/msgTopBg.gif'); color: #000\" width=5 height=24></TD>

<TD style=\"font-weight: normal; font-size: 12px; background-image: url('images/msgTopBg.gif'); color: #ffffff;padding-left:5px; padding-top: 4px\" vAlign=center width=\"1614\">MiningGo视频广告:</TD>

<TD style=\"background-image: url('images/msgTopBg.gif'); padding-right: 2px; padding-top: 2px\" vAlign=center align=right width=26><span title=关闭 style=\"CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px;\" onclick=closeDiv() >×</span><!--<IMG title=关闭 style=\"CURSOR: hand\" onclick=closeDiv() hspace=3 src=\"msgClose.jpg\">--></TD>

</TR>

<TR>

<TD colSpan=3 align=\"center\">

<object classid=\"clsid27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"230\" height=\"150\">

<param name=\"movie\" value=\"images/player.swf\">

<param name=\"quality\" value=\"high\">

<param name=\"allowFullScreen\" value=\"true\" />

<param name=\"FlashVars\" value=\"vcastr_file=http://www.mininggo.net/images/zhaoshang.flv&vcastr_title=MiningGo&BarColor=0xFFffff&BarPosition=1&IsShowBar=3&BarTransparent=10&LogoText=MiningGo.Net&IsAutoPlay=1\" />

<embed src=\"images/player.swf\" allowFullScreen=\"true\" FlashVars=\"vcastr_file=http://www.mininggo.net/images/zhaoshang.flv&vcastr_title=MiningGo&BarColor=0xFFffff&BarPosition=1&IsShowBar=3&BarTransparent=10&LogoText=MiningGo.Net&IsAutoPlay=1\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"230\" height=\"150\"></embed>

</object>

</TD>

</TR>

<tr>

<TD style=\"font-size: 12px; background-image: url('images/bomBg.gif');height:15px; line-height:15px; color: #ffffff;padding-top:2px;\" colSpan=3 width=240 height=15 align=\"center\">POWERED BY MiningGo</TD>

</tr>

</TBODY>

</TABLE>

</DIV>

js代码如下:

if (document.all){
window.attachEvent('onload',getMsg)
}
else{
window.addEventListener('load',getMsg,false);
}
window.onresize = resizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById(\"eMeng\".style.top,10)
divLeft = parseInt(document.getElementById(\"eMeng\".style.left,10)
divHeight = parseInt(document.getElementById(\"eMeng\".offsetHeight,10)
divWidth = parseInt(document.getElementById(\"eMeng\".offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight = document.documentElement.clientHeight;
document.getElementById(\"eMeng\".style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById(\"eMeng\".style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth
document.getElementById(\"eMeng\".style.visibility=\"visible\"
objTimer = window.setInterval(\"moveDiv()\",10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
//if(i>1300) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句
try{
divHeight = parseInt(document.getElementById(\"eMeng\".offsetHeight,10)
divWidth = parseInt(document.getElementById(\"eMeng\".offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight = document.documentElement.clientHeight;
document.getElementById(\"eMeng\".style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10);
document.getElementById(\"eMeng\".style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById(\"eMeng\".style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval(\"resizeDiv()\",1)
}
divTop = parseInt(document.getElementById(\"eMeng\".style.top,10)
document.getElementById(\"eMeng\".style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').innerHTML='';
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}

作者: php学习   发布时间: 2009-08-05

怎么没人。。。

作者: fangyuan312   发布时间: 2009-09-17

学习。。。。。。。。。

作者: daguohui   发布时间: 2009-09-17

谢谢分享

作者: lzwomen   发布时间: 2010-01-08