Pablo Garcia
Pablo Garcia

Reputation: 381

Nav panel in Jquery mobile

Hi I'm trying to implement a panel with 2 links. My idea is to have 3 different files: page1.html and page2.html

Page1:

<div>
    <h1> This is the Page 1</h1>
</div>

Page2:

<div>
    <h1>This is the Page 2</h1>
</div>

In my main page (main.html) I want to place the panel and a Div where the different pages will be loaded.

Is there any way to implement like fragments in Android, or similar, I mean, declare the div:

<div id="container"></div>

and when the users clicks on the links the content of the pages load in.

Thanks!

Upvotes: 0

Views: 60

Answers (1)

jcarrera
jcarrera

Reputation: 1068

You can use Navbar plugin:

<div data-role="navbar">
    <ul>
        <li><a href="page1.html">Page One</a></li>
        <li><a href="page2.html">Page Two</a></li>
    </ul>
</div><!-- /navbar -->

Please take a look to the Docs

Upvotes: 1

Related Questions