layer/demo.html

103 lines
4.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!doctype html>
<html>
<head>
<title>layer-更懂你的web弹窗解决方案</title>
</head>
<script src="http://res.xiami.net/pc/lay/lib.js"></script>
<script src="layer/layer.min.js"></script>
<style>
html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:'微软雅黑'}
a,a:hover{ text-decoration:none;}
pre{font-family:'微软雅黑'}
.box{padding:20px; background-color:#fff; margin:50px 100px; border-radius:5px;}
.box a{padding-right:15px;}
#about_hide{display:none}
.layer_text{background-color:#fff; padding:20px;}
.layer_text p{margin-bottom: 10px; text-indent: 2em; line-height: 23px;}
.button{display:inline-block; *display:inline; *zoom:1; line-height:30px; padding:0 20px; background-color:#56B4DC; color:#fff; font-size:14px; border-radius:3px; cursor:pointer; font-weight:normal;}
.imgs img{width:300px;}
</style>
<body>
<div class="box">
<pre>
@Name : layer v<script>document.write(layer.v)</script> 弹层组件说明
@author: 贤心
@Copyright: Sentsin Xu(贤心)
@blog: <a href="http://sentsin.com" target="_blank">http://sentsin.com</a>
@官网:<a href="http://sentsin.com/jquery/layer" target="_blank">http://sentsin.com/jquery/layer</a>
@授权:<a href="http://item.taobao.com/item.htm?id=37295654589" target="_blank">http://item.taobao.com/item.htm?id=37295654589</a>
【注意事项】
一、使用时请将layer整个文件夹放置你站点的任何一个目录只需引入layer.min.js即可css等其它文件无需引入。
二、如果您的js引入是通过合并处理或者您不想采用layer自动获取的绝对路径您需要打开layer.min.js 去配置相对路径url。默认采用自动获取layer所在的路径
三、jquery必须为1.8或1.8以上版本原因更小性能更好且新版layer使用了部分jq1.8+的特性下载包里即为jquery1.9下载地址
四、更多使用说明与演示demo请参见layer官网。
五、layer使用免费可应用于任何类型的web平台违法站除外使用时请务必保留来源。
六、如果您用于商业平台,您须经过授权。
七、您也可申请VIP技术服务。版权最终解释权贤心。
</pre>
</div>
<div class="box">
<h2 style="padding-bottom:20px;">layer1.8相册模块,点击下述图片试试</h2>
<div id="imgs" class="imgs">
<img src="http://static.oschina.net/uploads/space/2014/0516/012728_nAh8_1168184.jpg" layer-pname="layer宣传图">
<img src="http://sentsin.qiniudn.com/sentsinmy5.jpg" layer-pname="我入互联网这五年">
<img src="http://sentsin.qiniudn.com/sentsin_39101a660cf4671b7ec297a74cc652c74152104f.jpg" layer-pname="微摄影">
<img src="http://sentsin.qiniudn.com/sentsinsan01.jpg" layer-pname="三清山">
</div>
</div>
<div class="box" style="text-align:center">
<a href="http://sentsin.com/jquery/layer/api.html" target="_blank">使用文档</a>
<a href="http://say.sentsin.com/say-706.html" target="_blank">更新日志</a>
<a href="http://say.sentsin.com/home-48.html" id="suggest">交流反馈</a>
</div>
<script>
;!function(){
$(function(){
layer.msg('hello,亲爱的朋友当你看到这个的时候意味着你已将layer下载到你的本地并正常地运行了它。layer是一款基于web的弹窗解决方案旨在为你的产品增强体验。', 15, {
rate: 'top',
type: -1,
shade: false
});
});
layer.use('extend/layer.ext.js', function(){
//初始加载即调用所以需放在ext回调里
layer.ext = function(){
layer.photosPage({
html: '<div style="padding:20px;">这里传入自定义的html<p>相册支持左右方向键支持Esc关闭</p><p>另外还可以通过异步返回json实现相册。更多用法详见官网。</p><p>'+ unescape("%u8FD8%u6709%u5E0C%u671B%u5927%u5BB6%u5E73%u65F6%u6709%u7A7A%u70B9%u4E0B%u5B98%u7F51%u7684%u5E7F%u544A%u54C8%uFF0C%u4E00%u5929%u4E0D%u8981%u8D85%u8FC7%u4E00%u6B21%uFF0C%u8C22%u8C22%u62C9") +'</p><p id="change"></p></div>',
title: '快捷模式-获取页面元素包含的所有图片',
id: 112, //相册id可选
parent: '#imgs'
});
};
});
$('#suggest').on('click',function(event){
var height = $(window).height(), index = $.layer({
type : 2,
fix : false,
shade : [0.5 , '#000' , true],
shadeClose : true,
border : [!0],
title : false,
offset : ['25px',''],
area : ['90%', (height - 50)+'px'],
iframe : {src : $(this).attr('href')}
});
event.preventDefault();
});
}();
</script>
</body>
</html>