Js右下角视频广告代码(百度视窗)

右下角视窗
请看窗口右下角

var BD_HY_VIDEOAD={};(function(){var F={videoId:"BD_HY_VIDEOAD_"+new Date().getTime().toString().substring(5,13),bgFlashShow:0,bdLogoShow:"true",bdSmallShow:"true",bdLogo:"http://eiv.baidu.com/mapm2/0306videoTest/malogo.gif",bdSmallLogo:"http://eiv.baidu.com/mapm2/0306videoTest/malogo.gif",cookieTime:1200000,playerWidth:340,playerHeight:300,minWidth:177,minHeight:85,bgWidth:450,bgHeight:400,playerSrc:"http://eiv.baidu.com/mapm2/0306videoNewPlayer/videoad.swf",videoSrc:"http://eiv.baidu.com/mapm2/ddt0129/1.flv",imageSrc:"http://eiv.baidu.com/mapm2/ddt0129/1.jpg",bgSrc:"http://eiv.baidu.com/mapm2/0224videobg.swf",logoSwf:"http://eiv.baidu.com/mapm2/ddt0129/logo2.jpg",logoPic:"http://eiv.baidu.com/mapm2/ddt0129/logo.jpg",words:"\u767e\u5ea6\u5f39\u5f39\u5802\u706b\u7206\u5f00\u670d \u6ce8\u518c\u65e2\u9001 \u767e\u5143\u5927\u793c",ctIfShow:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3491&tu=d3d3LmJhaWR1LmNvbQ%3D%3D&std=0",ctAutoPlay:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3492&tu=d3d3LmJhaWR1LmNvbQ%3D%3D&std=0",ctReplay:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3492&tu=d3d3LmJhaWR1LmNvbQ%3D%3D&std=0",ctAllPlay:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3493&tu=d3d3LmJhaWR1LmNvbQ%3D%3D&std=0",ctClose:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3494&tu=d3d3LmJhaWR1LmNvbQ%3D%3D&std=0",ctVideoUrl:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3490&tu=aHR0cDovL3lvdXhpLmJhaWR1LmNvbS9wcm9tLnhodG1sP2NvZGU9JUI2JUU3JUFFJUU0JUJEJUQ1JTkyZSUyRiU5NyVGRG4lODk0JUY4JUEz&std=0",ctImageUrl:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3490&tu=aHR0cDovL3lvdXhpLmJhaWR1LmNvbS9wcm9tLnhodG1sP2NvZGU9JUI2JUU3JUFFJUU0JUJEJUQ1JTkyZSUyRiU5NyVGRG4lODk0JUY4JUEz&std=0",ctLogoUrl:"http://tk.baidu.com/tk-rcv/sv/click.php?trid=3490&tu=aHR0cDovL3lvdXhpLmJhaWR1LmNvbS9wcm9tLnhodG1sP2NvZGU9JUI2JUU3JUFFJUU0JUJEJUQ1JTkyZSUyRiU5NyVGRG4lODk0JUY4JUEz&std=0"},K=null,R=0,P=!window.opera&&(navigator.appVersion.indexOf("MSIE")!=-1),J=P&&(!window.XMLHttpRequest),$=document.compatMode=="CSS1Compat",S=!P||(!J&&$);function M(B,E,D,C,_,A){if(D){var $=new Date();$.setTime($.getTime()+D)}document.cookie=B+"="+encodeURIComponent(E)+((D==null)?"":";expires="+$.toGMTString())+((C==null)?"":";path="+C)+((_==null)?"":";domain="+_)+((A)?";secure":"")}function D(A){var $="(?:; )?"+A+"=([^;]*);?",_=new RegExp($);if(_.test(document.cookie))return decodeURIComponent(RegExp.$1);else return null}function Q(A,$,_){if(A.addEventListener)A.addEventListener($,_,false);else if(A.attachEvent)A.attachEvent("on"+$,_);else A["on"+$]=_}BD_HY_VIDEOAD.setPosition=function(_){var $=document.getElementById(F.videoId+"_div");K=_;if(_=="close"){M("BD_HY_VIDEOAD","close",F.cookieTime);N(F.ctClose);I();$.style.display="none"}else if(_=="big"){if(!S)L();$.style.width=F.playerWidth+"px";$.style.height=F.playerHeight+"px"}else if(_=="small"){$.style.width=F.minWidth+"px";$.style.height=F.minHeight+"px";if(!S)L()}};BD_HY_VIDEOAD.logoClick=function(){window.open(F.ctLogoUrl,"BDvideoAdNewWindow")};BD_HY_VIDEOAD.videoClick=function(){window.open(F.ctVideoUrl,"BDvideoAdNewWindow")};BD_HY_VIDEOAD.videoPicClick=function(){window.open(F.ctImageUrl,"BDvideoAdNewWindow")};BD_HY_VIDEOAD.videoAutoPlay=function(){N(F.ctAutoPlay);G()};BD_HY_VIDEOAD.videoReplay=function(){N(F.ctReplay);G()};BD_HY_VIDEOAD.videoStop=function(){N(F.ctAllPlay);I()};BD_HY_VIDEOAD.videoToSmall=function(){I()};function N($){(new Image(1,1)).src=$+"&sendtime="+new Date().getTime().toString()}function E(A,_,B){if(document.compatMode&&$){A.style.top=document.documentElement.scrollTop+(document.documentElement.clientHeight-B)-1;A.style.left=document.documentElement.scrollLeft+(document.documentElement.clientWidth-_)-1}else{A.style.top=document.body.scrollTop+(document.body.clientHeight-B)-1;A.style.left=document.body.scrollLeft+(document.body.clientWidth-_)-1}}function L(){var _=document.getElementById(F.videoId+"_div");if(K=="big")E(_,F.playerWidth,F.playerHeight);else if(K=="small")E(_,F.minWidth,F.minHeight);if(F.bgFlashShow==1&&R==1){var $=document.getElementById(F.videoId+"_bg");$.style.position="absolute";if($)E($,F.bgWidth,F.bgHeight)}}function H(){var $=document.getElementById(F.videoId+"_div");if($){$.style.position="absolute";L();Q(window,"resize",L);Q(window,"scroll",L)}}function G(){if(F.bgFlashShow==1&&R==0){var $=document.createElement("div");$.innerHTML=O(F.videoId+"_bgflash",F.bgSrc,F.bgWidth,F.bgHeight);$.id=F.videoId+"_bg";if(S){$.style.position="fixed";$.style.right=0;$.style.bottom=0}$.style.zIndex=2047483647;document.body.appendChild($);R=1;if(!S)L()}}function I(){if(F.bgFlashShow==1&&R==1){document.body.removeChild(document.getElementById(F.videoId+"_bg"));R=0}}function O(D,C,B,A,$){var _=''+''+''+''+''+''+'';return _}function B($){var _="mode="+$+"&logomove="+F.logoSwf+"&logopic="+F.logoPic+"&vid="+F.videoSrc+"&words="+F.words+"&vpic="+F.imageSrc+"&sl="+F.bdLogoShow+"&ssl="+F.bdSmallShow+"&bdlogo="+F.bdLogo+"&bdslogo="+F.bdSmallLogo;return _}function A(){var A=O(F.videoId+"_player",F.playerSrc,F.playerWidth,F.playerHeight,B(K)),$=document.createElement("div");$.innerHTML=A;$.id=F.videoId+"_div";$.style.zIndex=2147483647;$.style.overflow="hidden";$.style.position="fixed";$.style.right=0;$.style.bottom=0;if(K=="small"){$.style.width=F.minWidth+"px";$.style.height=F.minHeight+"px"}else if(K=="big"){$.style.width=F.playerWidth+"px";$.style.height=F.playerHeight+"px"}_($);if(!S)H();N(F.ctIfShow)}function _($){if(P){if(document.readyState=="complete")document.body.appendChild($);else document.onreadystatechange=function(){if(document.readyState=="complete")document.body.appendChild($)}}else document.body.appendChild($)}function C(){var $=D("BD_HY_VIDEOAD");if($!="close")if($=="small"){K="small";A()}else{K="big";A();M("BD_HY_VIDEOAD","small",F.cookieTime)}}Q(window,"load",C)})()

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

使用的朋友可以根据需要修改。

(0)

相关推荐

  • 又一个不错的js浮动广告代码

    var Rimifon = { "Ads" : new Object, "NewFloatAd" : function(imgUrl, strLink) { var ad = document.createElement("a"); ad.DirV = true; ad.DirH = true; ad.AutoMove = true; ad.Image = new Image; ad.Seed = Math.random(); ad.Timer

  • 兼容性非常好的js右下角与漂浮广告代码

    兼容ie6 7 8 ,ff3.5 3.6,chrome 4.1.2,safari 重新修正 1.滚动时抖动的问题,主要体现在ff3.6上 2.加入了ie6下的固定 3.分成了两个块,xhtml,html解析 4.随着屏幕大小而变动 兼容ie6 7 8 ff3.5 3.6 chrome 4.1.2 safari xhtml1.0解析 Untitled Document html,body{ padding:0; margin:0; } 我在随平滚 我静止不动 function scrollx(p)

  • js网页侧边随页面滚动广告效果实现

    a.scrollTop的计算: b.滚动元素的定位值计算: c.滚动周期设定: 代码如下: css部分: 复制代码 代码如下: /*测试用的高度*/ body{ height:3000px;} div,ul,li,body{margin:0; padding:0;} /*position:absolute;用于元素的定位*/ #roll{width:50px; height:100px; background:#99CC00; position:absolute;} Html代码: 复制代码 代

  • 兼容多浏览器的JS 浮动广告[推荐]

    漂浮广告是我们经常用到的广告形式,站长的必备代码,相信你一定能用得上. JS浮动广告 img{border:0;} function addEvent(obj,evtType,func,cap){ cap=cap||false; if(obj.addEventListener){ obj.addEventListener(evtType,func,cap); return true; }else if(obj.attachEvent){ if(cap){ obj.setCapture(); re

  • js退弹 IE关闭时弹出广告代码,可以防止屏蔽

    在网上寻觅了很久JS退弹代码,也没有找出让人非常满意的代码.于是今天把收集的退弹代码做了一下整理,精简出一个非常短小精悍而强力的JS退弹代码,能够突破现在绝大多数浏览器的限制,包括SP2.IE6.IE7.遨游.MYIE等等. 现提供给有这方面需求的用户: 完整版24小时只弹一次的代码 复制代码 代码如下: function Get(){ var Then = new Date() Then.setTime(Then.getTime() + 24*60*60*1000) //这里是24小时,如果想

  • JS实现悬浮移动窗口(悬浮广告)的特效

    js方法: 复制代码 代码如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>    <head>        <title> New Document </title>        <meta name="Gener

  • js仿拉勾网首页穿墙广告效果

    效果图: 代码如下: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Title</title> <style> *{margin:0; padding:0; list-style:none;} ul{ overflow:hidden; width:630px; margin:100px auto;} ul li{ float:le

  • 用javascript实现的仿Flash广告图片轮换效果

    <!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-

  • js漂浮广告实现代码(合集经典) 符合W3C

    第一种 漂浮广告 不符合W3CJavaScript漂浮广告代码,很不错,代码精简,不过一次只有漂一个,复制就能用了.希望站长朋友喜欢. 漂浮广告 var x = 50,y = 60 var xin = true, yin = true var step = 1 var delay = 10 var obj=document.getElementById("codefans_net") function float() { var L=T=0 var R= document.body.c

  • js 居中漂浮广告

    程序源码 复制代码 代码如下: var floatAd = {}; floatAd.getScrollTop = function(node) { var doc = node ? node.ownerDocument : document; return doc.documentElement.scrollTop || doc.body.scrollTop; }; floatAd.getScrollLeft = function(node) { var doc = node ? node.ow

随机推荐