I’m trying to get a good page transition in my app. Using HTML and javascript. I tryed the data-transition attribute but it’s very slow.
The solution I come up with is reading html files and pasting them into the index.html and using css3 animation for a page transition.
I also tryed this with ajax:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
$.ajax({
url: 'test.html',
success: function(data) {
console.log('success');
console.log(data);
},
error: function() {
console.log('error');
}
});
}
log:
success
[object Document]
How can I successfully read my html file which is in the www folder?
I found the answer:
With this code I load the test.html into a div with id=”page1″ which is inside the body.
How I do the page transition:
In this example I navigate from the login.html to the test.html and back. Both html files are loaded into the index.html
index.html:
login.html:
test.html:
mycss.css: