Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Mobile Tabs and Anchors
    primarykey
    data
    text
    <p>I would like create a tabbed mobile page using jQuery Mobile. I have got the basics of creating tabs (For Example Tab1, Tab2, Tab3, Tab4) and having each tab load a new page of content. <strong>The question I have is how would I go about using an anchor within a specific tab?</strong> So for example if someone wanted to bookmark a link that took them right to Tab4 Anchor1. </p> <p>I am pretty new to Javascript and jQuery. Any help would be appreciated. </p> <p>Thanks</p> <p>Code Below:</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;title&gt;test&lt;/title&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css"&gt; &lt;!-- JavaScript HTML requirements --&gt; &lt;script src="http://code.jquery.com/jquery-1.6.3.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" data-theme="d" id="home" data-id="nav"&gt; &lt;header data-role="header" &gt; &lt;h1&gt;TEST&lt;/h1&gt; &lt;div data-role="navbar" data-id="nav"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#home" data-icon="home" data-theme="d" class="ui-btn-active ui-state-persist" &gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#speakers" data-icon="star" data-theme="d"&gt;Speakers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" data-icon="grid" data-theme="d"&gt;News&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/header&gt; &lt;section data-role="content"&gt; Home &lt;/section&gt; &lt;footer data-role="footer" class="ui-bar"&gt; &lt;a href="" data-icon="gear" class="ui-btn-right"&gt;Buy Tickets&lt;/a&gt; &lt;/footer&gt; &lt;/div&gt; &lt;div data-role="page" data-theme="d" id="speakers"&gt; &lt;header data-role="header" data-id="nav" &gt; &lt;h1&gt;TEST&lt;/h1&gt; &lt;div data-role="navbar" &gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#home" data-icon="home" data-theme="d"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#speakers" data-icon="star" data-theme="d" class="ui-btn-active ui-state-persist"&gt;Speakers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" data-icon="grid" data-theme="d"&gt;News&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/header&gt; &lt;section data-role="content"&gt;The name attribute specifies the name of an anchor. The name &lt;a href="#jib"&gt;attribute&lt;/a&gt; is used to create a bookmark inside an HTML document. Note: The upcoming HTML5 standard suggests using the id attribute instead of the name attribute for specifying the name of an anchor. Using the id attribute actually works also for HTML4 in all modern browsers. Bookmarks are not displayed in any special way. They are invisible to the reader. &lt;a name="jib"&gt;&lt;/a&gt; Speakers &lt;/section&gt; &lt;footer data-role="footer" class="ui-bar"&gt; &lt;a href="" data-icon="gear" class="ui-btn-right"&gt;Buy Tickets&lt;/a&gt; &lt;/footer&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload