代码如下,高手有没有好的办法,让第二个tab选项卡中的图片也显示,谢谢:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<div class="div2"> </div>
<div class="div">
<div class="top">
<ul>
<li id="one1" onclick="setTab('one',1,2)" class="click">测试1</li>
<li id="one2" onclick="setTab('one',2,2)">继续测试2</li>
</ul>
</div>
<div class="content">
<div id="con_one_1" class="ceshi" style="display:block;">
<ul>
<li><img src="https://www.cnop.net/uploadfile/2013/1204/20131204053900188.gif" data-original="http://www.laoadmin.com/chendan/remen_005.png" width="200" height="110" /></li>
<li><img src="https://www.cnop.net/uploadfile/2013/1204/20131204053900188.gif" data-original="https://www.cnop.net/uploadfile/2013/1204/20131204053901385.png" width="200" height="110" /></li>
<li><img src="https://www.cnop.net/uploadfile/2013/1204/20131204053900188.gif" data-original="https://www.cnop.net/uploadfile/2013/1204/20131204053904608.png" width="200" height="110" /></li>
</ul>
</div>
<div id="con_one_2" class="ceshi">
<ul>
<li><img src="https://www.cnop.net/uploadfile/2013/1204/20131204053900188.gif" data-original="http://www.laoadmin.com/chendan/remen_005.png" width="200" height="110" /></li>
<li><img src="https://www.cnop.net/uploadfile/2013/1204/20131204053900188.gif" data-original="https://www.cnop.net/uploadfile/2013/1204/20131204053901385.png" width="200" height="110" /></li>
<li><img src="https://www.cnop.net/uploadfile/2013/1204/20131204053900188.gif" data-original="https://www.cnop.net/uploadfile/2013/1204/20131204053904608.png" width="200" height="110" /></li>
</ul>
</div>
<div style="clear:both"></div>
</div>
</div>
<div class="div2"> </div>
<link href="http://www.laoadmin.com/chendan/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.laoadmin.com/chendan/lazy.js"></script>
<script type="text/javascript" src="http://www.laoadmin.com/chendan/dy.js"></script>
<script type="text/javascript">
$(function() { $("img").lazyload(); });
</script>
</body>
</html>
高难....
可以尝试将:
<script type="text/javascript"> $(function() { $("img").lazyload(); });</script>
替换为:
<script type="text/javascript">$("img").lazyload({ skip_invisible : false, effect:"fadeIn"});</script>
也可以替换为:
<script type="text/javascript"> $(function() { $("img").lazyload({ event : "sporty" }); }); $(window).bind("load", function() { var timeout = setTimeout(function() { $("img").trigger("sporty") }, 5000); }); </script>
可实现页面打开一定时间后加载图片