gridlayout.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>jQuery Mobile: Grid Layout</title>
  6. <link rel="stylesheet" href="../../jquery.mobile-1.0.1.min.css" />
  7. <link rel="stylesheet" href="../../docs/_assets/css/jqm-docs.css" />
  8. <script src="../../jquery.js"></script>
  9. <script src="../../jquery.mobile-1.0.1.min.js"></script>
  10. <script>
  11. $(function(){
  12. $(".ui-grid-d a").bind("tap click", function(e){
  13. $(this).hide();
  14. $("#log")
  15. .prepend("<li>"+ e.type +" event; target: "+ e.target.nodeName +"; message: grid '"+$(this).text()+"' hidden</li>")
  16. .listview("refresh");
  17. return false;
  18. }).bind("tap click", false);
  19. $("#showbtn").bind("tap click", function(e){
  20. $(".ui-grid-d a").show();
  21. $("#log")
  22. .prepend("<li>"+ e.type +" event; target: "+ e.target.nodeName +"; message: show all buttons</li>")
  23. .listview("refresh");
  24. }).bind("tap click", false);
  25. });
  26. </script>
  27. </head>
  28. <body>
  29. <div data-role="page" data-theme="b" id="jqm-home">
  30. <div data-role="header">
  31. <h1>Grid Layout</h1>
  32. </div>
  33. <div data-role="content">
  34. <p>Touch events on this page will log out below, prepending to the top as they arrive.</p>
  35. <div class="ui-grid-d">
  36. <div class="ui-block-a">
  37. <a data-role="button" id="btn1" data-theme="b">Button 1</a>
  38. </div>
  39. <div class="ui-block-b">
  40. <a data-role="button" id="btn2" data-theme="b">Button 2</a>
  41. </div>
  42. <div class="ui-block-c">
  43. <a data-role="button" id="btn3" data-theme="b">Button 3</a>
  44. </div>
  45. <div class="ui-block-d">
  46. <a data-role="button" id="btn4" data-theme="b">Button 4</a>
  47. </div>
  48. <div class="ui-block-e">
  49. <a data-role="button" id="btn5" data-theme="b">Button 5</a>
  50. </div>
  51. </div>
  52. <a data-role="button" id="showbtn">Show all button</a>
  53. <ul data-role="listview" id="log">
  54. </ul>
  55. </div>
  56. </div>
  57. </body>
  58. </html>