Recently I was asked about jQuery’s resize event. It runs its resize while the users resizes the window – meaning it can be triggered hundreds of times before ending the resize. Is there a way to wait until the user is done resizing?
I know jQuery isn’t the coolest kid on the block anymore, but I thought this still could be useful for anyone wondering about the same thing.
The solution I propose is to add a timer to the resize event. Whenever the resize event runs, it will hold off for a specific amount of time until running it’s script. Using this, we can register our own resize-start and resize-end events.
The threshold is something you can set yourself. For the example code I used 250ms.
Here are some other posts you may like
Recently the WP-admin has gotten more attention from core developers. The Media section recently got a grid design, and the plugins area also got a visual improvement. A thought that followed; why not do the same for the User section? This idea first came around for me while working on…
Update: The referral program is coming to an end, Febuary 1st. To qualify for 6 months of free supercharging, use a referral code before this date at the purchase of a Tesla Model 3, S or X. https://twitter.com/elonmusk/status/1085771520058679297 Tesla certainly does things differently. One thing that really puts this into…
Electric power companies, in general, are pretty much the same. Tibber however, is unlike any electricity company I had seen before. They try to utilise the data we get from smart devices, which they also sell, to save electricity, money and the environment, as well as improving comfort. It’s a…