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

After some scrool and window resize sticky panel stays fixed #14

Open
GoogleCodeExporter opened this issue Mar 12, 2015 · 2 comments
Open

Comments

@GoogleCodeExporter
Copy link

Thanks for plugin. The bug I described in summary. My suggestion is just to add 
$(window).resize event which would call unstick method on node and after 
timeout scrool. I did like that and it fixes problem.

Original issue reported on code.google.com by [email protected] on 9 Apr 2013 at 8:55

@GoogleCodeExporter
Copy link
Author

I'm having the same issue, but I can't seem to get $(window).resize event 
working. 
Any tips? 

Original comment by [email protected] on 23 Apr 2013 at 1:44

@GoogleCodeExporter
Copy link
Author

What I did I just added resize handler to plugin init function like that

$(window).resize(function(){
 methods.unstick(options.element);
 Em.run.next(methods,function(){this.scroll(options.element);});//call resize to remove add fix
}); 

Em.run.next - is just some kind js timeout method to call function on next 
rool-up. It should be called in methods context though - inside of function 
this==methods.

And in scrool I changed this:
 var node = event.data.selected;
to this:
 var node = (event.originalEvent)?event.data.selected:event;//call from resize to remove resize bug

And as you see I needed to add reference to element for scooling to options 
(options.element).

That's my dirty workaround. But it works as expected.

Original comment by [email protected] on 23 Apr 2013 at 2:19

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

No branches or pull requests

1 participant