This article mainly introduces the resize event of the div under jquery written by a great God. For more information, see
This is the resize event of the div under jquery written by a great god. The Code is as follows: // resize of div (function ($, h, c) {var a = $ ([]), e = $. resize = $. extend ($. resize, {}), I, k = "setTimeout", j = "resize", d = j + "-special-event", B = "delay ", f = "throttleWindow"; e [B] = 250; e [f] = true; $. event. special [j] = {setup: function () {if (! E [f] & this [k]) {return false;} var l = $ (this); a =. add (l); $. data (this, d, {w: l. width (), h: l. height ()}); if (. length = 1) {g () ;}, teardown: function () {if (! E [f] & this [k]) {return false;} var l = $ (this); a =. not (l); l. removeData (d); if (! A. length) {clearTimeout (I) ;}, add: function (l) {if (! E [f] & this [k]) {return false;} var n; function m (s, o, p) {var q = $ (this ), r = $. data (this, d); r. w = o! = C? O: q. width (); r. h = p! = C? P: q. height (); n. apply (this, arguments);} if ($. isFunction (l) {n = l; return m;} else {n = l. handler; l. handler = m ;}}; function g () {I = h [k] (function () {. each (function () {var n = $ (this), m = n. width (), l = n. height (), o = $. data (this, d); if (m! = O. w | l! = O. h) {n. trigger (j, [o. w = m, o. h = l]) ;}}); g () ;}, e [B]) ;}} (jQuery, this ); in this way, You Can $ ('div '). resize (fucntion (){..}); now