Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throttle makeImagesResponsive for window resize event to twice per second. FIxes #4 #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adambom
Copy link

@adambom adambom commented Feb 20, 2014

Did a couple things. Wrap the entire program in a closure to allow us to safely create local variables. Also introduced a local throttle function, which will execute the given function at most every wait ms (see http://underscorejs.org/docs/underscore.html#section-71).

When attached to the window's resize event, we instruct makeImagesResponsive to execute at most every 500ms, or twice per second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant