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

Pre-determining the current breakpoint on configuration #24

Closed
wants to merge 1 commit into from

Conversation

bucha
Copy link

@bucha bucha commented Jun 3, 2013

Hi Ryan, in my current project I'm binding quite a lot of logic to the crossover-event and realized, that after the page being loaded, the crossover-event is being fired when resizing the window for some px (but not actually crossing a breakpoint). The problem resides in the Elemset.reset() method

// tempIndex is the index of the breakpoint
// while this.i === 0 initially
if (tempIndex !== this.i) { /* ... */ }

So I added some logic to determine this.i initially inside the configure-method. Maybe I'm doing something wrong here and this is rubbish, but please check my changes. Cheers, Alex

@ryanve
Copy link
Owner

ryanve commented Jun 20, 2013

@bucha Crossover callbacks tend to fire a few pixels away from the actual breakpoint being crossed. It depends on how fast the viewport is resized. See /test, open the console, and resize the window. I'm not sure how initializing this.i helps. Is it just that you need your callback to fire once initially? Perhaps you could initiate via the .ready() and use Response.crossover() for subsequent calls? Please elaborate on your usage so that we can better understand your overall intent. Thanks =]

@ryanve ryanve closed this Feb 27, 2014
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.

2 participants