Js下拉无刷新

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>iscroll.js</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
    
<script src="http://files.cnblogs.com/xinlinux/iscroll.js"></script> 
<style type="text/css">

#wrapper{
    overflow:hidden;
}

</style>

</head>
<body>
    
    <div id="wrapper" class="c1">

        <div id="scroller">

               <ul>

                    <li>
                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    
                    <li>
                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    <li>
                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    
                    <li>
                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    <li>
                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    
                    <li>
                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>

                    <li>

                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    <li>

                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>

                    <li>

                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>
                    <li>

                        <p>亲们挨饿,我等罪该万死<img src="http://wx.podapi.com/resource/script/kindeditor/plugins/emoticons/images/9.gif" border="0" alt="">,动动小指,告诉我你想吃啥呦。</p>
                        <p>晚上21:00~23:00进行配送.</p><p>电话:18829242503 QQ:2476403790</p>
                    </li>

                </ul>

       </div>

</div>
    
    <script>
        $(function(){
        
            $(body,html).css(overflow,hidden);
            
            loaded("wrapper","c1","scroller");
            
            
            
            
        })
        
        
        function loaded(id,part,nextD){      
        
            var minH  = document.documentElement.clientHeight || document.body.clientHeight;
            var  offT = $(.+part).offset().top;
            var offH = $(#+nextD).height();
            var boxMinH = minH-offT-10;
            if(boxMinH<=offH){
                $(.+part).css({height:boxMinH+px})
            }
            
            myScroll = new iScroll(id,{vScrollbar:false,hScroll:false,fixedScrollbar:true})
        }
    
    </script>
    
    
</body>
</html>

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。