jquery Event-resize () method

Source: Internet
Author: User

listens for window scaling events to construct the size for the current object. jquery provides a resize event that binds a handler function in each of the resize events of a matching element, such as resizing, aligning, and so on, triggering when the document window changes size
There are two kinds of listening methods, one is the browser window monitoring, one is the object scaling of monitoring (by clicking on the status bar's zoom scale implementation)
For the monitoring of Windows:
<span>$ (window). Resize (function () {      Resizer ($ (this));  Do sonrthing  });
</span>


Listener for object scaling:
<span>$ ("#ObjId"). Resize (function () {        Resizer ($ (this));  Do sonrthing   });</span>


This way, when encapsulating some jquery plug-ins, you can properly consider two kinds of event monitoring, so that we do the plug-in has a better user experience.


Binding Resizer Events

<span>$ (window). Bind (' Resize ', function () {var leftposition = inactiveb.position (). LEFT;INACTIVE.CSS (" Position "," absolute "); Inactive.css (" left ", Leftposition);}); </span>


jquery Event-resize () method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.