Tôi cố gắng hiển thị chỉ báo hoạt động trong ứng dụng của mình. Tôi đang sử dụng activity.js
cho chỉ báo hoạt động. Đó là một trong những hoạt động tốt trong trình duyệt và iPhone Nhưng nó không hoạt động trong các thiết bị Android.Chỉ báo hoạt động di động jQuery không hiển thị trong android
Tôi không biết tại sao chỉ báo không hoạt động trên các thiết bị Android.
Đây là mẫu mã của tôi cho chỉ số hoạt động:
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;
}
Nó sẽ giúp đỡ nếu bạn cung cấp những con số phiên bản của phần mềm mà bạn đang sử dụng (như jQueryMobile) và cho dù bạn đang nhìn thấy hành vi này trên trình duyệt hay trong một ứng dụng đã biên dịch có chế độ xem web. –