Stewie Griffin
Stewie Griffin

Reputation: 9337

jquery mobile subpage does not work

I want to use jQuery Mobile subpages plugin (https://github.com/ToddThomson/jQuery-Mobile-Subpage-Widget) , so added div under 'PAGE' like this:

 <div class="content-view" data-role="page" id="details">

    <div id="detailsSubPage" data-role="subpage">
        <div data-role="header" data-position="fixed">
            <h1>
                TESTING SUBPAGE</h1>                
        </div>
    </div>
</div>

then outside this I have a link to the subpage:

   <a href="#details&ui-page=detailsSubPage" data-ajax="false" >

but it does not work, it opens a blank page, not showing this demo header.. what am I missing here?

Upvotes: 1

Views: 1755

Answers (2)

user2361197
user2361197

Reputation: 21

this is the right structure: /div data-role="page" class="list-view-page" id="list"/

main page content /div data-role="subpage" class="list-view-page" id="overview2" /

subpage content //div close div

/div data-role="subpage" class="list-view-page" id="overview"/ subpate content 2 //div close div

//div>//close page div

Upvotes: 0

lox
lox

Reputation: 1622

To my knowledge that is not what the widget offers.

You can not link from outside the main page directly to a sub page.

The widget enables you to ajax-load (with a nice transition) a multi-page with functioning sub pages.

Without the widget you would have to load the main page without ajax otherwise the sub page would not be enabled.

Upvotes: 3

Related Questions