Skip to content

Commit d69d396

Browse files
committed
Merge pull request jquery#53 from AliciaLippert/master
API Doc: Revised vMouseDown
2 parents 9aa4c0b + 35d1708 commit d69d396

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

entries/vmousedown.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
<?xml version="1.0"?>
22
<entry name="vmousedown" type="event" return="jQuery">
3-
<title>.vmousedown()</title>
3+
<title>vmousedown</title>
44
<desc>Virtualized mouseover event handler.</desc>
55
<longdesc>
6-
<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>
6+
<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>
7+
<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>
8+
79
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
810
<pre>
911
<code><![CDATA[
1012
$(function(){
11-
$("p").vmousedown(function(){
13+
$(document).on("vmousedown", "p", function(){
1214
$(this).append('<span style="color:#00F;">Mouse down.</span>');
1315
});
1416
]]></code>
1517
</pre>
1618
</longdesc>
1719
<added>1.0</added>
1820
<signature>
19-
<argument name="callback" type="Function" optional="true">
20-
<desc>A function to invoke after the vmousedown event is fired.</desc>
21+
<argument name="preventDefault" type="Function" optional="true">
22+
<desc>A function to invoke in the event binding to prevent the synthetic click event by the browser.</desc>
2123
</argument>
24+
2225
</signature>
2326
<pre>
2427
<code>

resources/vmousedown/example1.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
<body>
1212
<p>Touch here, move up and down to see what happens.</p>
1313
<script>
14-
$("p").mousedown(function(){
15-
$(this).append('<span style="color:#00F;">Mouse down.</span>');
16-
});
14+
$(function(){
15+
$(document).on("vmousedown", "p", function(){
16+
$(this).append('<span style="color:#00F;">Mouse down.</span>');
17+
});
1718
</script>
1819
</body>
1920
</html>

0 commit comments

Comments
 (0)