瀑分开布分开流图片显示
来源:互联网 发布:华为网络营销策划书 编辑:程序博客网 时间:2024/04/29 22:44
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="{::RES}/css/Photo/css/css1/photo.css" media="all" />
<link rel="stylesheet" type="text/css" href="{::RES}/css/Photo/css/css1/photoswipe.css" media="all" />
<script type="text/javascript" src="{::RES}/css/Photo/js/js1/jQuery.js"></script>
<script type="text/javascript" src="{::RES}/css/Photo/js/js1/jquery_imagesloaded.js"></script>
<script type="text/javascript" src="{::RES}/css/Photo/js/js1/jquery_wookmark_min.js"></script>
<script type="text/javascript" src="{::RES}/css/Photo/js/js1/klass_min.js"></script>
<script type="text/javascript" src="{::RES}/css/Photo/js/js1/code_photoswipe_min.js"></script>
<script type="text/javascript" src="{::RES}/css/Photo/js/js1/jquery_lazyload.js"></script>
<title>{:$tpl.wxname}</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<!-- Mobile Devices Support @begin -->
<meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta content="no-cache" http-equiv="pragma">
<meta content="0" http-equiv="expires">
<meta content="telephone=no, address=no" name="format-detection">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes" /> <!-- apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<!-- Mobile Devices Support @end -->
<style>
img{width:100%!important;}
</style>
</head>
<body onselectstart="return true;" ondragstart="return false;">
<body id="photo" ondragstart="return false;" onselectstart="return false;">
<script type="text/javascript">
(function(window){
document.addEventListener('DOMContentLoaded', function(){
var PhotoSwipe = window.Code.PhotoSwipe;
var options = {loop:false},
instance = PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), options );
}, false);
})(window);
</script>
<script>
function scanLoad(){//扫描需要加载的div
$.each($("a"),function(i,o){
var windowHeight=$(window).height();
var scrollTop=$(document).scrollTop();
windowHeight=windowHeight*(4/5);//测试当图片出现在窗口上半部分时显示,实际操作中,应该不要除以2的
if( $(o).offset().top<(scrollTop+windowHeight) && $(o).offset().top > scrollTop )//判断div是不是出在可见的位置
{
// var img=$("<img/>").attr("src",$(o).attr("pic")).fadeTo("fast",0);//创建一个可见度为0的图片,地址为div上面的pic属性
// $(o).replaceWith(img);//把div替换成这个新创建的图片
// img.fadeTo("slow",1);//让它慢慢的显示出来
$(o).children().fadeTo("slow",1);
}
});
}
$(function(){//页面第一次加载时
scanLoad();//扫描需要加载的div
$(document).scroll(scanLoad);//当滚动条滚动时,扫描需要加载的div
$("body").scroll(scanLoad);//加这个为了某些浏览器的兼容
$(window).scroll(scanLoad);//加这个也是为了某些浏览器的兼容
});
</script>
<div class="body">
<div class="con">
<div id="main" role="main">
<ul id="Gallery" class="gallery">
<volist name="photo" id="photo">
<li style="">
<a href="{:$photo.picurl}">
<img src="{:$photo.picurl}" style="opacity: 0;" >
</a>
</li>
</volist>
</ul>
</div>
</div>
</div>
<footer style="text-align:center; color:#000;margin-right:20px;margin-top:0px; font-size:12px;">
<php>echo htmlspecialchars_decode(C('copyright'))</php>
</footer>
<!--下面是瀑|布|流js-->
<script type="text/javascript">
(function ($){
$('#Gallery').imagesLoaded(function() {
// Prepare layout options.
var options = {
autoResize: true, // This will auto-update the layout when the browser window is resized.
container: $('#main'), // Optional, used for some extra CSS styling
offset: 4, // Optional, the distance between grid items
itemWidth: 150 // Optional, the width of a grid item
};
// Get a reference to your grid items.
var handler = $('#Gallery li');
// Call the layout function.
handler.wookmark(options);
});
})(jQuery);
</script>
</body>
</body>
</html>
0 0
- 瀑分开布分开流图片显示
- 【Matplotlib】图例分开显示
- 数据和界面显示分开
- webview文字图片分开加载
- 如何让多份word文档分开显示
- android- WebView 文字 、图片分开加载
- android- WebView 文字 、图片分开加载
- 转:android- WebView 文字 、图片分开加载
- android WebView 文字 、图片分开加载
- 分开旅行
- 分开旅行
- 分开之后
- ITEXT 表与表格标题不分开,图与图片标题不分开
- Outlook Express怎样让相同主旨的邮件分开显示
- java JComboBox显示值与绑定至分开
- kindeditor编辑器和图片上传独立分开的配置细节
- 将数组分开
- 分开不一定分手
- 45个实用的JavaScript技巧、窍门和最佳实践
- 无法截断表 'item',因为该表正由 FOREIGN KEY 约束引用。
- StringBuffer和StringBuilder
- 一篇很全面的freemarker教程
- android 软件盘弹出时的界面控制
- 瀑分开布分开流图片显示
- overloaded Function in c++
- 1012
- 东软睿道实训推荐:无经验的求职者应该如何准备面试(3)
- 1013
- ON_EVENT 报错
- JS千分位处理
- 1014
- CUDA Performance Tips