layer/demo/demo.html

109 lines
4.6 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>
<script src="http://res.xiami.net/pc/lay/lib.js"></script>
<script src="../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>
</head>
<body>
<div class="box">
<pre>
@Namelayer-v<script>document.write(layer.v)</script> 弹层组件说明
@Author贤心
@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>
<strong>【注意事项】</strong>
一、使用时请把文件夹layer整个放置在您站点的任何一个目录只需引入layer.min.js即可除jQuery外其它文件无需再引入。
二、如果您的js引入是通过合并处理或者您不想采用layer自动获取的绝对路径您需要打开layer.min.js 去配置相对路径url。默认采用自动获取layer所在的路径
三、jquery必须为1.8或1.8以上版本原因更小性能更好且新版layer使用了部分jq1.8+的特性下载包里doc文件里有jquery1.9下载地址
四、更多使用说明与演示demo请参见layer官网。
五、使用时请务必保留来源请勿用于违反我国法律的web平台。
六、layer遵循LGPL协议将永久性提供无偿服务。版权最终解释权贤心。
</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" alt="layer宣传图">
<img src="http://sentsin.qiniudn.com/sentsinmy5.jpg" alt="我入互联网这五年">
<img src="http://sentsin.qiniudn.com/sentsin_39101a660cf4671b7ec297a74cc652c74152104f.jpg" alt="微摄影">
<img src="http://sentsin.qiniudn.com/sentsinsan01.jpg" alt="三清山">
</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({
type: 2,
title: [
'官网',
'background:#2B2E37; height:40px; color:#fff; border:none;' //自定义标题样式
],
border:[0],
area: ['90%', '90%'],
iframe: {src: 'http://sentsin.com/jquery/layer/?from=local'}
})
layer.msg('hello亲爱的朋友当你看到这个的时候<br>意味着你已将layer下载到你的本地并正常地运行了它。<br>layer是一款基于web的弹窗解决方案<br>旨在为你的产品增强体验。', 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,
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>