3 Star 0 Fork 0

Gitee 极速下载/jquery-smartAD

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/jsonzou/jquery-smartAD
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 5.28 KB
一键复制 编辑 原始数据 按行查看 历史
寻觅一只耳朵 提交于 2014-02-18 09:29 +08:00 . No commit message
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="jquery.js"></script>
<script src="jquery.smartAD.js"></script>
<script>
$(function(){
/*
//调用参数
var option={
position:"",//广告悬挂位置.默认右下角(br)。可选值[tl|tm|tr|mm|ml|mr|mlt|mlb|mrt|mrb|bl|bm|br].字母意义:t(top上),b(bottom下),l(left左),r(right右),m(middle中).方式一,方式二建议必须写上position.方式三可以不受约束,方式三声明position默认就是dom所在位置。
style:{
height:0,//高
width:0,//宽
background:"",//背景,窗体头部背景色
border:"",//边框
top:0,//顶部位置
left:0//左边位置
},//广告窗体样式
close:true,//是否可关闭
header:true,//是否显示广告窗体头部
fixed:true,//是否固定位置浮动窗口显示。方式一,方式二调用默认是true,方式三调用默认是false.
content:"",//广告内容,一般是图片,或html代码
link:"#",//广告链接
delay:0,//广告窗体延迟消失时间
delayFunc:contants.delayFunc,//广告窗体消失效果函数,为jQuery自带函数,默认淡出(fadeOut)。可选值:[fadeOut,hide,slideUp]
before:null,//广告加载前回调函数function(option,win,winHeader,winBody){}.option:配置参数,win:广告窗体jQuery对象,winHeader:广告窗体头部jQuery对象 ,winBody:广告窗体body的jQuery对象
after:null//广告加载后回调函数function(option,win,winHeader,winBody){}.option:配置参数,win:广告窗体jQuery对象,winHeader:广告窗体头部jQuery对象 ,winBody:广告窗体body的jQuery对象
}
*/
//支持三种调用方式:
//方式一:函数$smartAD(option)
$smartAD({
position:'tm',"link":"http://www.baidu.com",content:"我是广告哦,我在上中部显示",
before:function(option,win,winHeader,winBody){
alert(option.link);
},
after:function(option,win,winHeader,winBody){
winHeader.css("background","#1e4e7b");
},
});
//方式二:函数jQueryObject.smartAD(option)
$("#ad1").smartAD({position:'ml',delay:2000,delayFunc:"slideUp",link:"http:/www.youku.com",content:"广告1在这边"});
$("#ad2").smartAD({fixed:true,link:"http://www.baidu.com"});//jqueryObject生成的AD,如果需要浮动固定位置,必须显示的生命fixed:true.
$("#ad3").smartAD({position:"mm",link:"http://www.google.com",delay:6000});
//方式三:函数$.smartAD(option)
$.smartAD({"link":"http://www.baidu.com",style:{background:""},content:"我是广告4哦,我没有写方位,默认在右下角。"});
$smartAD({position:'mrt',fixed:false,close:false,"link":"http://www.baidu.com",content:"我是广告5哦,我不浮动,也没有关闭按钮。你拉动滚动条试试,我就不会浮动啦。"});
$smartAD({position:'bm',"link":"http://www.baidu.com",content:"我是广告6哦,我在底部"});
});
</script>
<title>首页</title>
</head>
<body>
<div style='width:500px;height:2000px;'>
<div id='ad1'>
我是广告1哦,我为什么还显示?是因为你给我加了content属性。
</div>
<div id='ad2' style='background:red;'>
我是广告2哦,没有方位,我就呆在div原位置,你拉动滚动条试试,我不会浮动。
</div>
<div id='ad3' style='background:green;'>
我是广告3哦,有方位我就呆在方位位置,现在我在中间的中间,而且我6秒后会消失的哦。
</div>
<textarea style="width:500px;height:400px;position:fixed;margin-top:-200px;margin-left:-250px;top:50%;left:50%;">
//调用参数
var option={
position:"",//广告悬挂位置.默认右下角(br)。可选值[tl|tm|tr|mm|ml|mr|mlt|mlb|mrt|mrb|bl|bm|br].字母意义:t(top上),b(bottom下),l(left左),r(right右),m(middle中).方式一,方式二建议必须写上position.方式三可以不受约束,方式三声明position默认就是dom所在位置。
style:{
height:0,//高
width:0,//宽
background:"",//背景,窗体头部背景色
border:"",//边框
top:0,//顶部位置
left:0//左边位置
},//广告窗体样式
close:true,//是否可关闭
header:true,//是否显示广告窗体头部
fixed:true,//是否固定位置浮动窗口显示。方式一,方式二调用默认是true,方式三调用默认是false.
content:"",//广告内容,一般是图片,或html代码
link:"#",//广告链接
delay:0,//广告窗体延迟消失时间
delayFunc:contants.delayFunc,//广告窗体消失效果函数,为jQuery自带函数,默认淡出(fadeOut)。可选值:[fadeOut,hide,slideUp]
before:null,//广告加载前回调函数function(option,win,winHeader,winBody){}.option:配置参数,win:广告窗体jQuery对象,winHeader:广告窗体头部jQuery对象 ,winBody:广告窗体body的jQuery对象
after:null//广告加载后回调函数function(option,win,winHeader,winBody){}.option:配置参数,win:广告窗体jQuery对象,winHeader:广告窗体头部jQuery对象 ,winBody:广告窗体body的jQuery对象
}
</textarea>
</div>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/jquery-smartAD.git
git@gitee.com:mirrors/jquery-smartAD.git
mirrors
jquery-smartAD
jquery-smartAD
master

搜索帮助