#Java Web累積#關於MUI的上滑和下拉載入

來源:互聯網
上載者:User

標籤:重新整理   3.0.0   highlight   jquer   不同   上拉載入   common   time   auto   

其實按照MUI的文檔去寫,也沒什麼問題:

JSP中:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title></title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="/resources/mui/mui.min.css" />
</head>

<body>

<div id="surveryList" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<!--資料列表-->
<ul class="mui-table-view mui-table-view-chevron toolList">
<li class="mui-table-view-cell">
第6個選項卡子項-8
</li>
<li class="mui-table-view-cell">
第6個選項卡子項-8
</li>
</ul>
</div>
</div>

</body>
</html>

<script src="/resources/mui/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/resources/js/lib/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="/resources/js/common/common.js" type="text/javascript"></script>
<script src="/resources/js/common/network.js" type="text/javascript"></script>
<script src="/resources/js/unique/survery/surveryforSupport.js" type="text/javascript"></script>

 

在js中:

$(function(){    AddListRefresh();});function AddListRefresh() {    mui.init({        pullRefresh: {            container: ‘#surveryList‘,            down: {                height: 50,//可選.預設50.觸發上拉載入拖動距離                auto: false,//可選,預設false.自動上拉載入一次                contentrefresh: "正在重新整理...",//可選,正在載入狀態時,上拉載入控制項上顯示的標題內容                callback: pulldownRefreshMySurvery            }        }    });}function pulldownRefreshMySurvery(){    setTimeout(function() {        mui(‘#surveryList‘).pullRefresh().endPulldownToRefresh();    }, 500);}

 

以上:

本次十分想記載一下,是因為,在本次的code中走了蠻多彎路。根據需求,使用了下標籤(tab)和 上標籤(segment),本使用同有個檔案來管理不同的table-item顯示。

造成在同一個jsp檔案中,需要有多個tableview的下拉或上拉重新整理。

嘗試了很多種方法,也查了很多資料,都不能很好的解決,那些不好的方法(mui.pullToRefresh.js)也就不記載了。

最後無奈,還是把使用iframe來完成這些。

還好,每個子頁面中,只init一個id的上拉或下拉,MUI還是能很好的支援。

#Java Web累積#關於MUI的上滑和下拉載入

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.