Greg
Greg

Reputation: 89

JQuery Mobile losing format

I have a problem working with JQuery.

After

 $.mobile.changePage(*toPage*);

is executed somehow the format of JQueryMobile is lost?

Is there an easy solution to tackle this problem?

Here is my HTML-Code:

    <form action="" data-bind=" template:{ 'if': loginVM, data: loginVM }" id="myLogin" data-role="page"> 
                     //Some Code
    </form>
<form action="" data-bind="template: { 'if': startVM, data: startVM }" id="myStart"  data-role="page">
                          //Some Code
    </form> 

Somehow if the DOM is altered the Style is lost!

Upvotes: 1

Views: 178

Answers (1)

David Aleu
David Aleu

Reputation: 3942

I believe each page should have a data-role with an id, so:

<div data-role="page" id="login">
    <form action="" data-bind=" template:{ 'if': loginVM, data: loginVM }" id="myLogin"> 
       //Some Code
    </form>
</div>
<div data-role="page" id="start">
    <form action="" data-bind="template: { 'if': startVM, data: startVM }" id="myStart">
      //Some Code
    </form> 
</div>

Upvotes: 1

Related Questions