buttons-events.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>jQuery Mobile Docs - Button events</title>
  7. <link rel="stylesheet" href="../../jquery.mobile-1.0.1.min.css" />
  8. <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
  9. <script src="../../jquery.js"></script>
  10. <script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
  11. <script src="../_assets/js/jqm-docs.js"></script>
  12. <script src="../../jquery.mobile-1.0.1.min.js"></script>
  13. </head>
  14. <body>
  15. <div data-role="page" class="type-interior">
  16. <div data-role="header" data-theme="f">
  17. <h1>Button basics</h1>
  18. <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
  19. </div><!-- /header -->
  20. <div data-role="content">
  21. <div class="content-primary">
  22. <form action="#" method="get">
  23. <h2>Button basics</h2>
  24. <ul data-role="controlgroup" data-type="horizontal" class="localnav">
  25. <li><a href="buttons-types.html" data-role="button" data-transition="fade">Basics</a></li>
  26. <li><a href="buttons-options.html" data-role="button" data-transition="fade">Options</a></li>
  27. <li><a href="buttons-methods.html" data-role="button" data-transition="fade">Methods</a></li>
  28. <li><a href="buttons-events.html" data-role="button" data-transition="fade" class="ui-btn-active">Events</a></li>
  29. </ul>
  30. <p>Bind events directly to the <code>a</code>, <code>input</code>, or <code>button</code> element. Use jQuery Mobile's <a href="../api/events.html">virtual events</a>, or bind standard JavaScript events, like change, focus, blur, etc.:</p>
  31. <pre><code>
  32. $( ".myButton" ).bind( "click", function(event, ui) {
  33. ...
  34. });
  35. </code></pre>
  36. <p>The <strong>form button</strong> plugin has the following custom events:</p>
  37. <dl>
  38. <dt><code>create</code> triggered when a form button is created</dt>
  39. <dd>
  40. <pre><code>
  41. $('[type='submit']').button({
  42. create: function(event, ui) { ... }
  43. });
  44. </code></pre>
  45. </dd>
  46. </dl>
  47. </form>
  48. </div><!--/content-primary -->
  49. <div class="content-secondary">
  50. <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
  51. <h3>More in this section</h3>
  52. <ul data-role="listview" data-theme="c" data-dividertheme="d">
  53. <li data-role="list-divider">Buttons</li>
  54. <li data-theme="a"><a href="buttons-types.html">Button basics</a></li>
  55. <li><a href="buttons-icons.html">Button icons</a></li>
  56. <li><a href="buttons-inline.html">Inline buttons</a></li>
  57. <li><a href="buttons-grouped.html">Grouped buttons</a></li>
  58. <li><a href="buttons-themes.html">Theming buttons</a></li>
  59. </ul>
  60. </div>
  61. </div>
  62. </div><!-- /content -->
  63. <div data-role="footer" class="footer-docs" data-theme="c">
  64. <p>&copy; 2011-2012 The jQuery Project</p>
  65. </div>
  66. </div><!-- /page -->
  67. </body>
  68. </html>