This is a migrated thread and some comments may be shown as answers.

Resized event (resize ends)

5 Answers 647 Views
Window
This is a migrated thread and some comments may be shown as answers.
Matjaz
Top achievements
Rank 1
Matjaz asked on 22 Jul 2014, 05:25 AM
Is there a resized or resizeEnd event on window?
I am saving width and height in localStorage, but I want to do that only when window is resized, not continuously when window is resizing.

5 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 22 Jul 2014, 08:51 AM
Hello Matjaz,

The resize event is triggered once the window has been resized.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Matjaz
Top achievements
Rank 1
answered on 22 Jul 2014, 09:49 AM
This is not true, or I didn't explain enough.
For every pixel that windows is resized, event is called. I want to call it when LeftMouseUp is fired.

I need to do some heavy operation and only when user finished resizing.

dojo example
0
Accepted
Alex Gyoshev
Telerik team
answered on 22 Jul 2014, 10:01 AM
Hello Matjaz,

Indeed, it appears that the online docs are misleading in that regard. I have logged this for implementation; see this dojo snippet for a work-around.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Matjaz
Top achievements
Rank 1
answered on 22 Jul 2014, 10:35 AM
Thanks.
0
Barry P
Top achievements
Rank 1
answered on 07 Sep 2015, 08:26 PM

I ran into this issue, too.  Only I was calling an ajax function to store window information on the server.

I worked around this by using a timeout.  It effectively waits until there is no resize for 1/2 second.

01.var _resizeTimeout = null;
02. 
03.window.bind("resize", function (e) {
04. 
05.    clearTimeout(_resizeTimeout);
06.    _resizeTimeout = setTimeout(function () {
07.        // ajax call to save window information on the server.
08.    }, 500);
09. 
10.});

Tags
Window
Asked by
Matjaz
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Matjaz
Top achievements
Rank 1
Barry P
Top achievements
Rank 1
Share this question
or