我嘗試顯示我的應用程序中的活動指標。我正在使用activity.js
作爲活動指標。這一個在瀏覽器和iPhone上工作正常但它不適用於Android設備。jQuery手機活動指標不顯示在android
我不知道爲什麼指標不工作在Android設備。
這裏是活動的指標我的示例代碼:
function showIndicator() {
console.log("inside show indicator");
applyOverLay();
var showIndicator = document.createElement("div");
showIndicator.setAttribute("class", "activity-indicator");
document.body.appendChild(showIndicator);
$('.activity-indicator').activity({
width: 5,
space: 1,
length: 3,
color: '#fff'
});
}
function applyOverLay() {
var overlay = document.createElement("div");
overlay.setAttribute("id", "overlayAttr");
overlay.setAttribute("class", "overlay");
document.body.appendChild(overlay);
}
function hideindicator() {
$('.activity-indicator').activity(false);
setTimeout(function() { $(".activity-indicator").empty().remove(); }, 0);
setTimeout(function() { $(".overlay").empty().remove(); }, 0);
}
function loadhtmlpage() {
//location.href='#refillReminder';
$.mobile.changePage("#refillReminder");
showIndicator();
hideindicator();
}
style.css:
.activity-indicator {
padding: 10px;
position: absolute;
top: 50%;
left: 45%;
z-index: 1001;
}
如果你提供你所使用的軟件的版本號這將有助於(如jQueryMobile)以及您是在瀏覽器上還是在具有Web視圖的已編譯應用程序中看到此行爲。 –