js2.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  7. <link rel="stylesheet" href="../style/weui.css"/>
  8. <link rel="stylesheet" href="../style/weui2.css"/>
  9. <link rel="stylesheet" href="../style/weui3.css"/>
  10. <script src="../zepto.min.js"></script>
  11. <script>
  12. $(document).on("click", "#act", function() {
  13. $.actions({
  14. title: "选择操作",
  15. onClose: function() {
  16. console.log("close");
  17. },
  18. actions: [
  19. {
  20. text: "发布",
  21. className: "color-primary",
  22. onClick: function() {
  23. $.alert("发布成功");
  24. }
  25. },
  26. {
  27. text: "编辑",
  28. className: "color-warning",
  29. onClick: function() {
  30. $.alert("你选择了“编辑”");
  31. }
  32. },
  33. {
  34. text: "删除",
  35. className: 'color-danger',
  36. onClick: function() {
  37. $.alert("你选择了“删除”");
  38. }
  39. }
  40. ]
  41. });
  42. });
  43. $(document).on("click", "#ac", function() {
  44. $.actions({
  45. actions: [
  46. {
  47. text: "发布",
  48. className: "bg-blue f-white",
  49. },
  50. {
  51. text: "编辑",
  52. className: "bg-green f-white",
  53. },
  54. {
  55. text: "删除",
  56. className: 'bg-orange f-white',
  57. }
  58. ]
  59. });
  60. });
  61. </script>
  62. </head>
  63. <body ontouchstart style="background-color: #f8f8f8;">
  64. <div class="page-hd">
  65. <h1 class="page-hd-title">
  66. 操作表
  67. </h1>
  68. <p class="page-hd-desc"></p>
  69. </div>
  70. <div class="page-bd-15">
  71. <a href="javascript:;" class="weui_btn weui_btn_primary" id="ac">操作表带颜色</a><a href="javascript:;" class="weui_btn weui_btn_primary" id="act">操作表</a>
  72. </div>
  73. </body>
  74. </html>