', {
'id': pluginName,
'class': pluginName
}).appendTo('body');
for(var i in options.ad){
var ad = options.ad[i];
ad = $.extend({}, ads, ad);
var div = $('
', {
'class': 'floatImg'
});
div.css("z-index", ad['z-index']);
var closeDiv = $('
', {
'class': 'floatPicClose'
});
closeDiv.appendTo(div);
var content = $('
');
$('
', {
href: ad.linkUrl,
target: ad.linkWindow,
title: ad.title
}).append(
$('
', {
'src': ad.img,
'style': (ad.imgHeight ? 'height:' + ad.imgHeight + 'px;' : '') +
(ad.imgWidth ? 'width:' + ad.imgWidth + 'px;' : '')
})
).appendTo(content);
content.appendTo(div);
div.appendTo(adDiv);
}
delete options.ad;
$('#' + pluginName).floatPic(options);
}
}
else
$.error('浮动模块出错!');
};
})(jQuery, window, document);
$.floatPic({
delay: 10,
//isLinkClosed: true,
ad: [{
'img': data[0].url,
'imgHeight': width,
'imgWidth': height,
'linkUrl': links,
'z-index': 100
}]
});
$(".floatPicClose").text("X");
},
mount:function(data,name,width,height){ // 泰山压顶
errorsAlert(width,height);
name == "" ? name = "body" : name;
noneLink(data[0].href);
var atmMount = "X!["+ data[0].title+"]("+ data[0].url +")
";
$(name).prepend(atmMount);
$(".mount").css("height",height);
$(".mount a").css("margin-left",-width/2);
$(".mount").slideDown(1200,function(){
setTimeout(function(){
$(".mount").slideUp(1000);
},5000);
});
bindClose(".mount_close",".mount");
},
bottomCenter:function(data,name,width,height){ // 底部浮动居中广告
errorsAlert(width,height);
name == "" ? name = "body" : name;
noneLink(data[0].href);
var atmBottomCenter = "X!["+ data[0].title+"]("+ data[0].url +")
";
$(name).prepend(atmBottomCenter);
$(".atm_bottom_pic").css("height",height);
$(".atm_bottom_pic a").css("margin-left",-width/2);
bindClose(".atm_bottom_pic_close",".atm_bottom_pic_bg");
},
bottomRight:function(data,name,width,height){ // 底部浮动居右广告
errorsAlert(width,height);
name == "" ? name = "body" : name;
noneLink(data[0].href);
var atmBottomRight = "X!["+ data[0].title+"]("+ data[0].url +")
";
$(name).prepend(atmBottomRight);
bindClose(".atm_bottom_pic_close",".atm_bottom_right");
},
randomPic:function(data,name,width,height){ // 随机单张广告
errorsAlert(width,height);
name == "" ? name = "body" : name;
var atmRandom,
i = parseInt(data.length*Math.random());
noneLink(data[i].href);
atmRandom = "!["+ data[i].title +"]("+ data[i].url +")
";
$(name).append(atmRandom);
},
picList:function(data,name,width,height){ // 图片罗列广告
errorsAlert(width,height);
name == "" ? name = "body" : name;
var i=0,
picList="";
for(i;i
";
}
$(name).append(picList);
}
}