大家好,Stackoverflow。
我在使用HTML5 / CSS构建的应用程序的预加载方面存在一些问题,但它必然是我的代码,但它可以在IOS上无缝地工作,而不是Android。
我知道Android存在持续存在的问题,但我的客户实际上正在攀爬这个问题。
我认为它与application.js中的代码有关,我附上了一个小提琴,看看是否有人可以帮助我。
//Rotation
window.onload = function () {
steroids.view.setAllowedRotations({
allowedRotations: [0, 180]
}, {
onSuccess: function () {
alert("Portait View.");
}
});
}
//Scroller
window.onload = function () {
var myScroll;
function loaded() {
myScroll = new IScroll('#content-padded', {
bounceEasing: 'elastic',
bounceTime: 1200,
mouseWheel: true,
scrollbars: true,
snap: true
});
}
document.addEventListener('touchmove', function (e) {
e.preventDefault();
}, false);
}
// Loads Home Layer
function showHome() {
var showView = new steroids.views.WebView({
location: "index.html"
});
// Pushes The Home Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Prices Layer
function showPrices() {
var showView = new steroids.views.WebView({
location: "prices.html"
});
// Pushes The Prices Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads
function showRides() {
var showView = new steroids.views.WebView({
location: "rides.html"
});
// Pushes The Rides Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Show a custom alert
//
function showBook() {
navigator.notification.alert(
'You are now being directed to our website, to confirm please click below', // message
showBook2, // callback
'Diggerland', // title
'Confirm' // buttonName
);
}
// Loads In App Browser (Book Tickets)
function showBook2() {
window.open('https://www.diggerland.com/bookings/site/book/1/', '_blank', 'location=yes');
}
// Loads Dates Layer
function showDates() {
var showView = new steroids.views.WebView({
location: "dates.html"
});
// Pushes The Dates Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Find Us Layer
function showFindus() {
var showView = new steroids.views.WebView({
location: "findus.html"
});
// Pushes The Find Us Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
function showGift() {
navigator.notification.alert(
'You are now being directed to our website, to confirm please click below', // message
showGift2, // callback
'Diggerland', // title
'Confirm' // buttonName
);
}
// Loads In App Browser (Gift Voucher)
function showGift2() {
window.open('https://www.diggerland.com/booking/vouchers.htm', '_blank', 'location=yes');
}
// Loads Groups Layer
function showGroups() {
var showView = new steroids.views.WebView({
location: "groups.html"
});
// Pushes The Groups Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Fan Club Layer
function showSpecial() {
var showView = new steroids.views.WebView({
location: "special.html"
});
// Pushes The Special Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Fan Club Layer
function showFanclub() {
var showView = new steroids.views.WebView({
location: "fanclub.html"
});
// Pushes The Special Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Links Layer
function showLinks() {
var showView = new steroids.views.WebView({
location: "links.html"
});
// Pushes The Links Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Newsletter Layer
function showNewsletter() {
var showView = new steroids.views.WebView({
location: "newsletter.html"
});
// Pushes The Newsletter Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads About Layer
function showAbout() {
var showView = new steroids.views.WebView({
location: "about.html"
});
// Pushes The About Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Social Layer
function showSocial() {
var showView = new steroids.views.WebView({
location: "social.html"
});
// Pushes The Social Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Loads Contact Layer
function showContact() {
var showView = new steroids.views.WebView({
location: "contact.html"
});
// Pushes The Contact Layer
steroids.layers.push({
view: showView,
keepLoading: false,
navigationBar: false,
tabBar: false,
animation: false
});
}
// Useful Links
// Loads Masterhitch
function loadDiggerland() {
window.open('http://www.diggerland.com', '_blank', 'location=yes');
}
// Loads Masterhitch
function loadDiggerlandBlog() {
window.open('http://www.diggerland.com/diggerland_blog', '_blank', 'location=yes');
}
// Loads HE Website
function loadHE() {
window.open('http://www.heservices.co.uk', '_blank', 'location=yes');
}
// Loads HE Blog
function loadHEBlog() {
window.open('http://www.heservices.co.uk/blog/', '_blank', 'location=yes');
}
// Loads Buy A Digger
function loadBuyADigger() {
window.open('http://www.buyadigger.com', '_blank', 'location=yes');
}
// Loads Masterhitch
function loadMasterhitch() {
window.open('http://www.masterhitch.co.uk', '_blank', 'location=yes');
}
// Social Media
// Loads Facebook
function showFB() {
window.open('http://www.facebook.com/diggerland', '_blank', 'location=yes');
}
// Loads Facebook
function showTwitter() {
window.open('http://www.twitter.com/diggerland_uk', '_blank', 'location=yes');
}
// Loads Facebook
function showYoutube() {
window.open('http://www.youtube.com/diggerland', '_blank', 'location=yes');
}
// Loads Facebook
function showGoogleplus() {
window.open('https://plus.google.com/117194821273482641459', '_blank', 'location=yes');
}
//emailHQ
function emailHQ() {
navigator.notification.alert(
'You are now being re-directed away and will close the app, to confirm please click below', // message
emailHQ2, // callback
'Diggerland', // title
'Confirm' // buttonName
);
}
function emailHQ2() {
window.location.href = "mailto:mail@diggerland.com?subject=Hi, Diggerland!";
}
function showTerms() {
window.open('http://www.diggerland.com/groups/groups.htm', '_blank', 'location=yes');
}
// Get There Functions
function get2Devon() {
window.open('https://www.google.co.uk/maps/dir//Diggerland,+Verbeer+Manor,+Willand,+Cullompton,+Devon+EX15+2PE/@50.8776498,-3.37899,17z/data=!4m13!1m4!3m3!1s0x486d9678e0520b9f:0x53301ff615bbe9be!2sDiggerland!3b1!4m7!1m0!1m5!1m1!1s0x486d9678e0520b9f:0x53301ff615bbe9be!2m2!1d-3.37899!2d50.87765', '_blank', 'location=yes');
}
function get2Durham() {
window.open('https://www.google.co.uk/maps/dir//Diggerland+Durham,+Langley+Park,+Co+Durham,+County+Durham+DH7+9TT/@54.8015144,-1.672773,17z/data=!4m12!1m3!3m2!1s0x487e7fb1498defeb:0xc11effaa3883f439!2sDiggerland+Durham!4m7!1m0!1m5!1m1!1s0x487e7fb1498defeb:0xc11effaa3883f439!2m2!1d-1.672773!2d54.801514', '_blank', 'location=yes');
}
function get2Kent() {
window.open('https://www.google.co.uk/maps/dir//Diggerland+Kent,+Medway+Valley+Leisure+Park,+Roman+Way,+Strood,+Kent+ME2+2NU/@51.3832876,0.4799531,17z/data=!4m12!1m3!3m2!1s0x47d8cc88a2b9e70d:0xad7a119954a4d7af!2sDiggerland+Kent!4m7!1m0!1m5!1m1!1s0x47d8cc88a2b9e70d:0xad7a119954a4d7af!2m2!1d0.479085!2d51.382977', '_blank', 'location=yes');
}
function get2Yorkshire() {
window.open('https://www.google.co.uk/maps/dir//Diggerland,+Willowbridge+Ln,+Castleford,+West+Yorkshire+WF10+5NW/@53.715696,-1.3824482,17z/data=!4m12!1m3!3m2!1s0x487969daab5232d1:0xa9dc523dcf5fe11b!2sDiggerland!4m7!1m0!1m5!1m1!1s0x487969daab5232d1:0xa9dc523dcf5fe11b!2m2!1d-1.382448!2d53.715696', '_blank', 'location=yes');
}
// Drawer
window.onload = function () {
var slideMenuButton = document.getElementById('slide-menu-button');
slideMenuButton.onclick = function (e) {
var cl = document.body.classList;
if (cl.contains('right-nav')) {
cl.remove('right-nav');
} else {
cl.add('right-nav');
}
};
}
如果有人能指出我下一步该做什么的正确方向以及如何克服这个问题,我将非常感激。
乔