I am trying to get height of a div, after window.resize
method, so that the element has its new height, but before display the output to the user, so I could change height of another div.
What I know already and not so tempted to use in this case
so back to question
Is there any event in JS or JQuery which could get me state where document is re sized but not displayed to user yet on the screen.
$(window).resize(WindowResizeNow);
You can use $(window).resize()
.
When you change the DOM in JS function, DOM is updated immediately, but a page is rendered after the function has been executed.
This might not be obvious in case of some events, which fire several times per second (like resize
and scroll
, keydown
etc.), but user might keep them as a single event.
If multiple handler calls cause troubles, they can be omitted by using a debouncer .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.