Skip to content

Commit ee22a14

Browse files
committed
API Doc: Update
1 parent 35bb786 commit ee22a14

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

entries/hashtag.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
<desc>A function to invoke after the onhashchange event is fired.</desc>
1414
</argument>
1515
</signature>
16-
<example>
17-
<desc>A simple jQuery Mobile hashchange example.</desc>
16+
<pre>
1817
<code><![CDATA[
1918
$(function(){
2019
// Bind an event to window.onhashchange that, when the hash changes, gets the
@@ -35,14 +34,9 @@
3534
// the event now, to handle the hash the page may have loaded with.
3635
$(window).hashchange();
3736
});
38-
]]></code>
39-
</example>
40-
<pre>
41-
<code>
42-
<p>Click, and watch as the magic happens!
43-
<iframe src="/resources/hashtag/example1.html" style="width:100%;height:90px;border:0px"></iframe>
44-
</p>
45-
</code>
46-
</pre>
37+
]]></code></pre>
38+
<p>Click, and watch as the magic happens!
39+
<iframe src="/resources/hashtag/example1.html" style="width:100%;height:90px;border:0px"></iframe>
40+
</p>
4741
<category slug="events"/>
4842
</entry>

entries/vmouseover.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0"?>
2+
<entry name="hashtag" type="event" return="jQuery">
3+
<title>.vmouseover()</title>
4+
<desc>Virtualized mouseover event handler.</desc>
5+
<longdesc>
6+
<p>The jQuery Mobile <code>.vmouseover()</code> event handler simulates the "onmouseover" event handler on mobile devices.</p>
7+
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
8+
</longdesc>
9+
<added>1.0</added>
10+
<signature>
11+
<argument name="callback" type="Function" optional="true">
12+
<desc>A function to invoke after the vmouseover event is fired.</desc>
13+
</argument>
14+
</signature>
15+
<example>
16+
<desc>A simple jQuery Mobile hashchange example.</desc>
17+
<code><![CDATA[
18+
$(function(){
19+
// Bind an event to window.onhashchange that, when the hash changes, gets the
20+
// hash and adds the class "selected" to any matching nav link.
21+
$(window).hashchange( function(){
22+
var hash = location.hash;
23+
24+
// Set the page title based on the hash.
25+
document.title = 'The hash is ' + ( hash.replace( /^#/, '' ) || 'blank' ) + '.';
26+
27+
// Iterate over all nav links, setting the "selected" class as-appropriate.
28+
$('#nav a').each(function(){
29+
var that = $(this);
30+
that[ that.attr( 'href' ) === hash ? 'addClass' : 'removeClass' ]( 'selected' );
31+
});
32+
})
33+
// Since the event is only triggered when the hash changes, we need to trigger
34+
// the event now, to handle the hash the page may have loaded with.
35+
$(window).hashchange();
36+
});
37+
]]></code>
38+
</example>
39+
<pre>
40+
<code>
41+
<p>Click, and watch as the magic happens!
42+
<iframe src="/resources/hashtag/example1.html" style="width:100%;height:90px;border:0px"></iframe>
43+
</p>
44+
</code>
45+
</pre>
46+
<category slug="events"/>
47+
</entry>

0 commit comments

Comments
 (0)