VueJs listener window. resize method example, vuejswindow. resize
Vuejs itself is a MVVM framework.
However, when listening for events on the window, it is often insufficient.
For example, this is window. resize.
Well, I did Baidu
Original article: fixed the window. Resize bug in IE6 IE7.
Address: http://www.cnblogs.com/rubylouvre/archive/2010/04/15/1712279.html
Directly use JavaScript to operate window. Resize. As an old system, add
Jquery is a waste of work, so you need to use the original JavaScript function.
Sometimes we need to do something dynamically when the browser window changes, such as adapting to the adaptive page. At this point, we need to execute the code when the window is dragged. But sometimes, the operation is more complicated, we just hope that after the window has been dragged, in the execution of code, it is very easy to cause the browser suspended
This article mainly through the code example to introduce the IE7 browser window size Change event to perform many bugs and ie6/ie7/ie8 under the resize problem, step-by-step introduction, first to introduce IE7 browser window size Change event to perform multiple bugs, specific problem analysis and solutions please see below.
var resizetimer = null;
$ (
Window. onresize event-specific event binder v0.1, used to solve the lteie8 amp; chrome and other bugs that may occur when the native window. resize event is executed multiple times.
The Code is as follows:
/*** Window. onresize event-specific event binder v0.1 Alucelx* Http://www.cnblogs.com/Alucelx/archive/2011/1
Resize
function Description: Set the size of the terminal window.syntax:resize [-cu][-s Supplemental Note: Execute resize instruction to set the window size of the virtual terminal.Parameters-C Even if the user environment is not C shell, also use C shell instructions to change the size of the window.-S -U even if the
This article mainly introduces the issue of executing multiple bugs in IE7 browser window size change events and the resize issue in IE6IE7IE8, if you need it, you can learn it together. This article mainly uses code examples to introduce the issue of multiple bugs in executing Windows size change events in IE7 and the issue of resize in IE6/IE7/IE8. step-by-step
JQuery Event-Resize () methodThe Resize event occurs when the size of the browser window is resized.The resize () method triggers the Resize event, or a function that runs when the Resize event occurs.var x=0; $ (
It should be a very famous bug. in IE6 IE7, resize the window. This event will be executed multiple times, or sometimes it is exaggerated to repeatedly repeat this callback function and get stuck in an endless loop, this causes a false death. For more information, see window. onresize hangs IE6 and IE7. The method provided in this article is to provide a counter
Colleagues in the project using the scroll event to load data, the result of IE tragedy. A simple optimization method is given, and the effect is obvious.
As long as the user changes the window size, the internal element size will be recalculated, which may cause the entire page to be rendered again, resulting in a large amount of CPU consumption. For example, call resize method, the user changes the
When the browser window size changes, use the Resize event to resolve the frame that is not working, as follows:
Copy Code code as follows:
$ (window). Resize (function () {
var Surh = $ (window). Height ();
$ (". Pic_conent"). Height (surh);
}
When the
Introduction:It is estimated that many comrades will encounter such a situation when writing the method of Browser resize ():
When dragging the corners of the browser, some of the effects in the page are triggered by changes in the size of the browser, and the process starts to the end, how many times are the methods in resize () executed?
jquery $ (window
Copy codeThe Code is as follows:/*** Window. onresize event-specific event binder v0.1 Alucelx* Http://www.cnblogs.com/Alucelx/archive/2011/10/20/2219263.html* * This vulnerability is used to solve the multiple execution bugs of lte ie8 chrome and other native window. resize events that may occur.* * * Add: add an event handle.* Remove: Delete the event handle.*
You waste
Note:
1. You do not need to add the onclick Method to the button to add all functions to $ (function.
2. Three files need to be introduced, including two JS files and one CSS file.
Jquery UI dialog usage Overview
OverviewA floating window contains the title and content. You can move, resize, and close the icon '× '.If the content length exceeds the display in the dialog box content area, t
Then there are several events on the page that dynamically add DOM elements. For example, clicking a layer will list the details of this layer, so there is no problem in FF and chrome, but in the IE6-8 every time re-layout.For example, when I drag a layer, the content in the middle layer is displayed at the bottom. When I open the layer, the layer jumps back to the position before the drag...At first, I didn't see that it was a re-layout... then I demonstrated N for a long time, struggled N for
Then there are several events on the page that dynamically add DOM elements. For example, clicking a layer will list the details of this layer, so there is no problem in ff and chrome, but in the IE6-8 every time re-layout.
For example, when I drag a layer, the content in the middle layer is displayed at the bottom. When I open the layer, the layer jumps back to the position before the drag...
At first, I didn't see that it was a re-layout... then I demonstrated N for a long time, struggled
VC + + Adjust the size of the control based on the dialog box size1. Add the member variable CRect m_rect in the dialog class to save the size before the size of the dialog box changes;2. In the OnInitDialog () function of the dialog box, get the size of the dialog box when it was created: GetClientRect (m_rect);3. Add the following code to the Wm_size response function OnSize ():1:private:CRect M_rect;2:getclientrect (m_rect);3:void Cbuttondlg::modify (cwnd* pwnd,int cx,int cy){if (pWnd){CRect
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.