麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 開發 > AJAX > 正文

jQuery+css3實現Ajax點擊后動態刪除功能的方法

2024-09-01 08:33:04
字體:
來源:轉載
供稿:網友

這篇文章主要介紹了jQuery+css3實現Ajax點擊后動態刪除功能的方法,可實現點擊選區后出現選區收縮、滾動消失的效果,涉及jquery結合Ajax與數學運算實時操作頁面元素的相關技巧,需要的朋友可以參考下

本文實例講述了jQuery+css3實現Ajax點擊后動態刪除功能的方法。分享給大家供大家參考。具體如下:

這里使用jquery實現ajax動態刪除一個方框,并帶有動畫緩沖效果,在google plus網站發現的特效,在此獻丑模仿了一番,已基本與Google Plusp功能相同,你可在方框中加入一些內容,jquery插件選的版本是1.6.2,更高版本也是可以的。

運行效果截圖如下:

jQuery+css3實現Ajax點擊后動態刪除功能的方法

具體代碼如下:

 

 
  1. <!DOCTYPE html> 
  2. <head> 
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  4. <title>jQuery+css3實現Ajax動態點擊刪除功能</title> 
  5. <script type="text/javascript" src="jquery-1.6.2.min.js"></script> 
  6. <script type="text/javascript"
  7. jQuery.easing['jswing'] = jQuery.easing['swing']; 
  8. jQuery.extend( jQuery.easing, 
  9. def: 'easeOutQuad'
  10. swing: function (x, t, b, c, d) { 
  11. return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 
  12. }, 
  13. easeInQuad: function (x, t, b, c, d) { 
  14. return c*(t/=d)*t + b; 
  15. }, 
  16. easeOutQuad: function (x, t, b, c, d) { 
  17. return -c *(t/=d)*(t-2) + b; 
  18. }, 
  19. easeInOutQuad: function (x, t, b, c, d) { 
  20. if ((t/=d/2) < 1) return c/2*t*t + b; 
  21. return -c/2 * ((--t)*(t-2) - 1) + b; 
  22. }, 
  23. easeInCubic: function (x, t, b, c, d) { 
  24. return c*(t/=d)*t*t + b; 
  25. }, 
  26. easeOutCubic: function (x, t, b, c, d) { 
  27. return c*((t=t/d-1)*t*t + 1) + b; 
  28. }, 
  29. easeInOutCubic: function (x, t, b, c, d) { 
  30. if ((t/=d/2) < 1) return c/2*t*t*t + b; 
  31. return c/2*((t-=2)*t*t + 2) + b; 
  32. }, 
  33. easeInQuart: function (x, t, b, c, d) { 
  34. return c*(t/=d)*t*t*t + b; 
  35. }, 
  36. easeOutQuart: function (x, t, b, c, d) { 
  37. return -c * ((t=t/d-1)*t*t*t - 1) + b; 
  38. }, 
  39. easeInOutQuart: function (x, t, b, c, d) { 
  40. if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 
  41. return -c/2 * ((t-=2)*t*t*t - 2) + b; 
  42. }, 
  43. easeInQuint: function (x, t, b, c, d) { 
  44. return c*(t/=d)*t*t*t*t + b; 
  45. }, 
  46. easeOutQuint: function (x, t, b, c, d) { 
  47. return c*((t=t/d-1)*t*t*t*t + 1) + b; 
  48. }, 
  49. easeInOutQuint: function (x, t, b, c, d) { 
  50. if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 
  51. return c/2*((t-=2)*t*t*t*t + 2) + b; 
  52. }, 
  53. easeInSine: function (x, t, b, c, d) { 
  54. return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 
  55. }, 
  56. easeOutSine: function (x, t, b, c, d) { 
  57. return c * Math.sin(t/d * (Math.PI/2)) + b; 
  58. }, 
  59. easeInOutSine: function (x, t, b, c, d) { 
  60. return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 
  61. }, 
  62. easeInExpo: function (x, t, b, c, d) { 
  63. return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 
  64. }, 
  65. easeOutExpo: function (x, t, b, c, d) { 
  66. return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 
  67. }, 
  68. easeInOutExpo: function (x, t, b, c, d) { 
  69. if (t==0) return b; 
  70. if (t==d) return b+c; 
  71. if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 
  72. return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 
  73. }, 
  74. easeInCirc: function (x, t, b, c, d) { 
  75. return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 
  76. }, 
  77. easeOutCirc: function (x, t, b, c, d) { 
  78. return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 
  79. }, 
  80. easeInOutCirc: function (x, t, b, c, d) { 
  81. if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 
  82. return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 
  83. }, 
  84. easeInElastic: function (x, t, b, c, d) { 
  85. var s=1.70158;var p=0;var a=c; 
  86. if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 
  87. if (a < Math.abs(c)) { a=c; var s=p/4; } 
  88. else var s = p/(2*Math.PI) * Math.asin (c/a); 
  89. return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 
  90. }, 
  91. easeOutElastic: function (x, t, b, c, d) { 
  92. var s=1.70158;var p=0;var a=c; 
  93. if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 
  94. if (a < Math.abs(c)) { a=c; var s=p/4; } 
  95. else var s = p/(2*Math.PI) * Math.asin (c/a); 
  96. return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 
  97. }, 
  98. easeInOutElastic: function (x, t, b, c, d) { 
  99. var s=1.70158;var p=0;var a=c; 
  100. if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 
  101. if (a < Math.abs(c)) { a=c; var s=p/4; } 
  102. else var s = p/(2*Math.PI) * Math.asin (c/a); 
  103. if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 
  104. return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 
  105. }, 
  106. easeInBack: function (x, t, b, c, d, s) { 
  107. if (s == undefined) s = 1.70158; 
  108. return c*(t/=d)*t*((s+1)*t - s) + b; 
  109. }, 
  110. easeOutBack: function (x, t, b, c, d, s) { 
  111. if (s == undefined) s = 1.70158; 
  112. return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 
  113. }, 
  114. easeInOutBack: function (x, t, b, c, d, s) { 
  115. if (s == undefined) s = 1.70158; 
  116. if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
  117. return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
  118. }, 
  119. easeInBounce: function (x, t, b, c, d) { 
  120. return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 
  121. }, 
  122. easeOutBounce: function (x, t, b, c, d) { 
  123. if ((t/=d) < (1/2.75)) { 
  124. return c*(7.5625*t*t) + b; 
  125. else if (t < (2/2.75)) { 
  126. return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 
  127. else if (t < (2.5/2.75)) { 
  128. return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 
  129. else { 
  130. return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 
  131. }, 
  132. easeInOutBounce: function (x, t, b, c, d) { 
  133. if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 
  134. return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 
  135. }); 
  136. </script> 
  137. <script type="text/javascript"
  138. $(document).ready(function() 
  139. $(".sqare").click(function() 
  140. $(this).animate({width:'100px',height:'100px'}, 500, 'linear'function() { 
  141. $(this).addClass('circle-label-rotate');  
  142. }).addClass('circle').html('<div class="innertext">Bye</div>').animate({"opacity":"0","margin-left":"510px"},1500,function(){ }); 
  143. $(this).slideUp({duration: 'slow',easing: 'easeOutBounce'}); 
  144. }); 
  145. }); 
  146. </script> 
  147. <style> 
  148. .circle-label-rotate {-webkit-animation-name: rotateThis;-webkit-animation-duration:2s;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear;} 
  149. @-webkit-keyframes rotateThis {from {-webkit-transform:scale(1) rotate(0deg);} 
  150. to{-webkit-transform:scale(1) rotate(360deg);}} 
  151. .circle{border-radius: 50px;-moz-border-radius: 50px; -webkit-border-radius: 50px;height:100px;width:100px;background:#dedede;} 
  152. .sqare{height:100px;width:500px;border:dashed 1px #000;margin-top:10px;} 
  153. .innertext{padding:40px;} 
  154. </style> 
  155. </head> 
  156. <body> 
  157. <div> <div height="125px" align='center'>  
  158. </div></div>  
  159. <div style='width:600px;margin:0 auto'
  160. <h4>請點擊虛線方框</h4> 
  161. <div class="sqare"
  162. </div> 
  163. <div class="sqare">這個方框是可以被刪除的 
  164. </div> 
  165. <div class="sqare"
  166. </div> 
  167. <div class="sqare"
  168. </div> 
  169. <div class="sqare"
  170. </div> 
  171. </div> 
  172. </body> 
  173. </html> 

希望本文所述對大家的jquery程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 亚洲日本韩国在线观看 | 成人一区二区在线观看视频 | 黄色免费播放网站 | 国产资源视频在线观看 | 国产在线欧美日韩 | 亚洲成在人 | 黄色小视频在线免费看 | 成人18在线| 一级黄色片在线看 | 成人毛片免费看 | 欧美性生交zzzzzxxxxx | 成人免费电影在线观看 | 91在线视频精品 | 毛片视频网址 | 狠狠久久 | 久久久久久中文字幕 | 久久久久久免费免费 | 操操操操网 | 黄色毛片视频在线观看 | 又黄又爽免费无遮挡在线观看 | 久色视频网站 | 成人激情在线观看 | 97精品国产高清在线看入口 | 日本在线视频一区二区三区 | 激情久久精品 | 97超级碰碰人国产在线观看 | 日日狠狠久久 | 国产亚洲精品综合一区91555 | 国产一区二区三区在线免费观看 | 欧美成人综合视频 | 国产成人自拍视频在线 | 久久一级 | 国产午夜探花 | 黄色大片免费网站 | 国产一区二区在线免费播放 | 色淫网站免费视频 | 日本欧美一区二区三区在线播 | 成年人激情在线 | 国产精品美女久久久久久不卡 | 国产免费一级 | 国产精品一区99 |