0
可能重複:
jQuery Mobile styles for an asynchronously included div
Jquery mobile listview - check initialization is completeCSS在AJAX加載缺失
我有一個移動的jQuery列表視圖中,有一個加載更多的按鈕結束。但是使用了AJAX的CSS是缺少對新加入的結果一切正常。
這裏是我的按鈕代碼
<div data-role="fieldcontain">
<a onclick="loadmore(this);" type="button" id="showmore" href="#more">Load more..</a>
</div>
的Javascript正確的ListView
function loadmore(a) {
jq("#show_more_btn").removeClass("show_more_btn");
jq("#show_more_btn").addClass("loading_btn");
jq("this").css("display", "none");
if (null == jq.cookie("bp-activity-oldestpage")) jq.cookie("bp-activity-oldestpage", 1, {
path: "/"
});
var b = jq.cookie("bp-activity-oldestpage") * 1 + 1;
jq.post(ajaxurl, {
action: "activity_get_older_updates",
cookie: encodeURIComponent(document.cookie),
page: b
}, function (a) {
jq("#show_more_btn").removeClass("loading_btn");
jq("#show_more_btn").addClass("show_more_btn");
jq.cookie("bp-activity-oldestpage", b, {
path: "/"
});
jq("li[class='load-more']").hide();
jq("#activity-stream").append(a.contents);
}, "json");
return false
}
截圖 http://s12.postimage.org/yd2hsk119/original.jpg
問題 http://s17.postimage.org/81ofaf1bz/got.jpg
編輯: 列表視圖代碼
<div class="content-primary">
<ul data-role="listview" id="activity-stream">
<?php endif; ?>
<?php while (bp_activities()) : bp_the_activity(); ?>
<?php locate_template(array('activity/entry.php'), true, false); ?>
<?php endwhile; ?>
<?php if (empty($_POST['page'])) : ?>
</ul>
</div>
Entry.php
<li id="activity-<?php bp_activity_id(); ?>">
<a href...>...</a>
<h3>...</h3>
<p>...</p>
</li>
任何人都知道是什麼問題?
上面的鏈接可能不會100%的回答你的問題,但這個下一個鏈接,你就可以做你的需要:http://stackoverflow.com/questions/9493215/jquery-mobile-listview-check-initialization -is完成/ 9493671#9493671。這一問題已經在討論S.O.時間的數 – Jasper
http://stackoverflow.com/questions/9493215/jquery-mobile-listview-check-initialization-is-complete/9493671#9493671 –