Skip to content

Commit 38a8575

Browse files
committed
API Doc: vmouse changes
Quick fix in vmousedown xml, changes in example and xml for vmousemove.
1 parent 35d1708 commit 38a8575

File tree

3 files changed

+62
-8
lines changed

3 files changed

+62
-8
lines changed

entries/vmousedown.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<entry name="vmousedown" type="event" return="jQuery">
33
<title>vmousedown</title>
4-
<desc>Virtualized mouseover event handler.</desc>
4+
<desc>Virtualized mousedown event handler.</desc>
55
<longdesc>
66
<p>The jQuery Mobile <code>vmousedown</code> event handler simulates the "onmousedown" event handler on mobile devices. This event is fired on the initial touch of the screen on the device.</p>
77
<p>The idea behind virtualized mouse events is to translate touch events into mouse events. Developers should be aware that these virtualized mouse events will not prevent any synthetic mouse events from being triggered inside the browser after a touch event. If a mouse-type device is used on the system, the virtualized mouse events are dispatched at the same time as the normal mouse events.</p>
@@ -15,6 +15,9 @@
1515
});
1616
]]></code>
1717
</pre>
18+
<p>
19+
<iframe src="/resources/vmousedown/example1.html" style="width:100%;height:90px;border:0px"></iframe>
20+
</p>
1821
</longdesc>
1922
<added>1.0</added>
2023
<signature>
@@ -23,12 +26,5 @@
2326
</argument>
2427

2528
</signature>
26-
<pre>
27-
<code>
28-
<p>
29-
<iframe src="/resources/vmousedown/example1.html" style="width:100%;height:90px;border:0px"></iframe>
30-
</p>
31-
</code>
32-
</pre>
3329
<category slug="events"/>
3430
</entry>

entries/vmousemove.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0"?>
2+
<entry name="vmousedown" type="event" return="jQuery">
3+
<title>vmousemove</title>
4+
<desc>Virtualized mouseover event handler.</desc>
5+
<longdesc>
6+
<p>The jQuery Mobile <code>vmousemove</code> event handler simulates the "onmousemove" event handler on mobile devices.</p>
7+
<p><i>The idea behind virtualized mouse events is to translate touch events into mouse events. Developers should be aware that these virtualized mouse events will not prevent any synthetic mouse events from being triggered inside the browser after a touch event. If a mouse-type device is used on the system, the virtualized mouse events are dispatched at the same time as the normal mouse events.</i></p>
8+
9+
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
10+
<pre>
11+
<code><![CDATA[
12+
$("#target").mousemove(function(event) {
13+
var msg = "Handler for .mousemove() called at ";
14+
msg += event.pageX + ", " + event.pageY;
15+
$("#log").append("<div>" + msg + "</div>");
16+
});
17+
]]></code>
18+
</pre>
19+
<p>
20+
<iframe src="/resources/vmousemove/example1.html" style="width:100%;height:90px;border:0px"></iframe>
21+
</p>
22+
</longdesc>
23+
<added>1.0</added>
24+
<methods>
25+
<method name="preventDefault" optional="true">
26+
<desc>A function to invoke in the event binding to prevent the synthetic click event by the browser.</desc>
27+
</method>
28+
29+
</methods>
30+
<category slug="events"/>
31+
</entry>

resources/vmousemove/example1.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>vmousedown demo</title>
7+
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css">
8+
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
9+
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
10+
</head>
11+
<body>
12+
<div id="target">
13+
Move here
14+
</div>
15+
<div id="other">
16+
Trigger the handler
17+
</div>
18+
<div id="log"></div>
19+
<script>
20+
$("#target").mousemove(function(event) {
21+
var msg = "Handler for .mousemove() called at ";
22+
msg += event.pageX + ", " + event.pageY;
23+
$("#log").append("<div>" + msg + "</div>");
24+
});
25+
</script>
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)