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
onSnapFinish and onSnapStart getting triggered unnecessarily #45
Comments
This should not be possible. Check the demos. |
By the way, do you have a live demo I take have a look at? That would make it a lot easier for me to help you out. |
Hi guido, |
*** I removed my e-mail as I prefer not seeing it on public sites like Github... *** This is the public board where issues can be discussed. No need to e-mail me about that. =] I took a quick glance at your project, but didn't see onSnapFinish fire twice. Nor did I see any double animations. Try creating an isolated implementation on jsfiddle.net, and continue from there. |
Sorry about it, I will set it on jsFiddle. Thank you |
HI there, Thanks |
That is not an isolated or stripped down version of your error. ;) This is isolated: Your errors:
Fixed version: |
Thanks for the reply,basically I was following your MENU example where you used data-panel with the same name i.e for menus and sections please check http://postimg.org/image/hj859un3h/ |
Yes, that creates a link between the menu item & the panel. But two panels with the same |
I I just checked my code and I dont see any panel with same data-panel value,please check |
But yes I am using similar data-panel values for menus because my requirement is something like this Please check,for circle menus I am using the data-panel values of each panel and also for GO TO LINKS I am using the same data-panel value. Do you think that is the reason the plugin gets called when we click any where on the page?? |
You had duplicate And like I said, the actual error that caused onSnapFinish to be triggered multiple times was no. 2, the margin collapse. |
Even in my fiddle also the data-panel is not getting repeated,please check http://jsfiddle.net/rameshteegapur/42UGQ/2/ I am able to handle onSnapFinish if gets triggered multiple times....but the main issue is that it gets triggered on click event..I mean if user clicks any thing on the page it gets triggered that is the main issue |
Like I told you: Fix your margins and you'll be fine. Your faulty CSS is confusing the plugin. About the So, yes, you are repeating |
Sorry I just realized that data-panel values were being set dynamically in JS file..but as you said its all because of CSS,I tried giving margins to the sections but the problem still exists. |
Only on the third panel. And that is still an issue in your CSS. Remove those padding & margins on your panels & set the height to 100%. Solved. I'm not really here to fix your errors. Sorry, but this discussion is getting way out of hand. I've proven that the issue is not within my code, and I've told you over 5 times now where to look to fix your code. And for that matter: Clean your code, it's a mess right now. If you can't find the fix, start from scratch with a working setup (from my demos), and slowly add features until you're at your design. |
I understand that completely and I really appreciate your help..Thanks for everything..I will work on my CSS now...you can close this ticket |
Hi, |
Please, look at: I told you, the double trigger occurred because you had a margin collapse. See the padding I added? That prevents the issue. I've explained this over five times now: |
Hi guidobouman, |
The panel height was higher than the viewport because you had collapsing margins. Custom sizing the panels will only bring you more issues in the future. Try to get a solid understanding of the box-model & margin collapsing. Just google them, there are thousands of articles about those two topics. |
Thank you for your valuable suggestion. |
Hi,
I am using this plugin for one of my project,everything works fine except that the plugin callback functions(onSnapFinish,onSnapStart) are getting called even when we click anywhere on the website,this happens in Chrome 34.0.1847.137 and Firefox 26.0.
Basically I am doing some animation on onSnapFinish but when user is clicking any menu or anywhere on the page, onSnapFinish gets triggered and my animation runs again.
Can you please check if its a bug or am I doing something wrong
Thanks
Ramesh
The text was updated successfully, but these errors were encountered: