언어 설정

Menu
Sites
Language
Same page transition with data change - right approach

 

I'll explain on example.

A have page with number:

 

By clicking "mooove" button i what to make page transition to same page with new number. For example let it will counter.

I want to change page data (number from 1 to 2) not before transition and not after. It should look like one page replaced by another with different data.

As i undestand, i have to generate new page based on main and then make transition. Or no?

I know about construction:

$.mobile.changePage('#main', {
    transition: "slide",
    allowSamePageTransition: true
});

Which approach is correct for this problem?

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

5 댓글
Vineet Tiwari
hi Sergey You can create new page and make the link redirect to it .
Sergey
Make? How? In index.html, or generate it by javascript? However, if i want to walk from 1st to 100th or maby 1000000th page?.... It not correct to create so many pages. I think, main page should be regenerated. But how to do it correctly?
Vineet Tiwari
then create div elements and make display style none for all except for the first , and when you click the link for page2 then hide div for page1 and show div for page2 index.html :
content for page1
Go To Page2 js File: $( "#link1" ).on( "click", function(event, ui) { $("#contentarea1").css({display:"none"}); $("#contentarea2").css({ display:"block"}); }); Hope this helps
Vineet Tiwari
index.html <div style="display:block" id="contentarea1">Content of page1</div> <div style="display:none" id="contentarea2">Content of page2</div> <a href="#" id="link1">Go To Page2</a>
Sergey
No. It is important to use page transition. Not hide and show. Hot .empty(), .html(), .text(), .append() or some another simple content changers. I need page transition.