I try to link virtual pages using jQuery Mobile, but I have two problems :
- The first time when I load the page, the CSS is not applied.
- After when I choose a page and I want to change to another page, I notice that every time I passed by the page 1.
This is my example.
Code :
var nbrButton = 3;
$(document).ready(function(){
for(i = 1;i <= nbrButton;i++) {
$("body").append('<div id="p'+i+'" data-role="page" class="pages"><div data-role="content">Page'+i+'</br><a data-role="button" rel="internal" href="#p1" data-inline="true">1</a><a data-role="button" rel="internal" href="#p2" data-inline="true">2</a><a data-role="button" rel="internal" href="#p3" data-inline="true">3</a></div></div>');
}
$("#p1").show();
});
Could you tell me what is the problem or if there is a better way to do that.
Thank you.