Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Keep track of how many times the event as been triggered versus how many times
- # the timer has been fired.
- resizeFiredTotal = 0
- reizeFiredCounter = 0
- # Bind a resize event to the window
- $(window).on 'resize', (e) ->
- # Increment the resize fired event by 1
- resizeFiredTotal += 1
- userResizing = () ->
- # Check if the timer has fired more than the resize event itself.
- if reizeFiredCounter >= resizeFiredTotal
- console.log 'Do anything now that the user has stopped resizing', e if console.log?
- else
- reizeFiredCounter += 2
- return
- # Call the userResizing every 500 milliseconds.
- setTimeout userResizing, 500
- return
Add Comment
Please, Sign In to add comment