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

Adding Class To Dom #366

Open
mralperem opened this issue May 6, 2020 · 1 comment
Open

Adding Class To Dom #366

mralperem opened this issue May 6, 2020 · 1 comment

Comments

@mralperem
Copy link

Hello I have a carousel on my website and a sidebar. I want to open the sidebar with swipe control which i have implemented succesfully but my carousel is not working properly now.

I dont want to open the menu when i swipe the carousel so could anyone please help me with the code. Thank you in advance.

$(function test() { $("body").swipe({ swipe: function(event, direction, distance, duration) { if (direction == "right") { if (carousel is not siwiped) { $("body").removeClass("sidebar-toggled"); $(".sidebar").removeClass("toggled"); } } else if (direction == "left") { if (carousel is not swiped) { $("body").addClass("sidebar-toggled"); $(".sidebar").addClass("toggled"); } } }, }); });

@mattbryson
Copy link
Owner

Looks like 'carousel is not siwiped' is not valid JS.

You could check the event.target to see what the user initially swiped on...

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

No branches or pull requests

2 participants