?
第32话(绑架) - 狼人归来亚博体育竞彩APP下载--任意三数字加yabo.com直达官网 - 恐怖 - 72亚博体育竞彩APP下载--任意三数字加yabo.com直达官网 亚博体育竞彩APP下载,yabo狗亚体育下载,YB亚博体育平台在线登录官方网站
share
- 报错
- 提示:方向键[→]下一页,方向键[←]上一页。
// 顶飘代码
;
(function() {
//广告信息 每{}是一条广告 AdUrl是落地页地址 PicUrl是图片地址
var ads = [{
"AdUrl": "http://mh.625329.com/?c=10003",
"PicUrl": ["http://www.72qier.com/tupian/3.gif", "http://www.72qier.com/tupian/2.gif","http://www.72qier.com/tupian/1.gif"]
}]
var ad = random_ad(ads),
mubuMax = document.createElement("div"),
zhaiwei = document.createElement("div");
mubuMax.id = "mu0"+Math.floor((Math.random() * 99));
//广告样式 可以修改广告高度
mubuMax.style.cssText = "position: fixed; right: 0; top: 0; width: 100%; height: 150px; z-index: 999999999999999; background: url(" + ad["PicUrl"][0] + ") top no-repeat; background-size: 100% auto;-webkit-animation: shake 1s linear infinite;animation: shake 1.5s linear infinite;";
document.body.appendChild(mubuMax);
//顶部占位
zhaiwei.style.cssText = "width:100%;height:150px";
var first=document.body.firstChild;//得到页面的第一个元素
document.body.insertBefore(zhaiwei,first);//在得到的第一个元素之前插入
var picbox = document.getElementById(mubuMax.id);
picbox.onclick = function() {
//绑定广告跳转
window.location.href = ad["AdUrl"]
};
//素材轮播
var idx = 1,
len = ad["PicUrl"].length;
setInterval(function() {
if (idx == len) {
idx = 0
};
picbox.style.backgroundImage = "url(" + ad["PicUrl"][idx] + ")";
idx++;
}, 3500)
function addNewStyle(newStyle) {
//添加动态效果
var styleElement = document.getElementById('styles_js');
if (!styleElement) {
styleElement = document.createElement('style');
styleElement.type = 'text/css';
styleElement.id = 'styles_js';
document.getElementsByTagName('head')[0].appendChild(styleElement);
}
styleElement.appendChild(document.createTextNode(newStyle));
}
//广告动态效果
addNewStyle('@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-8px)}20%,40%,60%,80%{-webkit-transform:translateX(8px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-8px)}20%,40%,60%,80%{-webkit-transform:translateX(8px)}}');
function random_ad(arr) {
//随机拿出一条广告
var index = Math.floor((Math.random() * arr.length));
return arr[index];
}
})();