-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Swipe with JQuery Mobile #287
Comments
I figured out a way to do it (remove the extra spaces around the div ("< div"): $(this).ekkoLightbox({ onContentLoaded: function() {
$('.lightbox-swipe').swipeleft(function() {
}); |
No that only worked on Desktop... either that or my cache on my phone is stuck... |
weird.. worked on phone with wifi turned on.. must be caching somewhere.. |
Swipe is already built in, see |
Thank you for the fast response - that is SUPER cool. Can I detect left and right swipe? Can you put a little more detail in the answer like a left an right swipe function with alert I could add to my javascript (not the ekko lightbox js) ? I am using the 4.0.2 tree for Bootstrap 3 (I think that's why I have to use 4.0.2 can't remember which of your support comments said it but one said I needed 4.0.2 to make it work) HOWEVER the solution I have works. OnContentLoaded I add a div to the body and position it fixed with the highest z-index so it is invisible and sits over the lightbox, and then I put the swipe on that. It works. Just had to wait for the server to propagate the changes or something to clear cache. When I woke up today my solution worked. So I am interested in your idea, but my solution works. I need JQuery Mobile Swipe for my other bootstrap carousels anyway. So, its not like its going anywhere. http://davidgallo.unaomnia.com/category/concerts-and-events/ Here is what I am working on.. I also added custom buttons. I just noticed my method covers the video though. So I am working on a way to handle that.. Have to get a cover behind the video.. Maybe your method would be better... I will wait to hear back and search around in the JS |
My gosh I am sorry. I tried once more to target .ekko-lightbox for the JQuery Mobile swipeleft and swiperight functions and it worked. http://davidgallo.unaomnia.com/category/concerts-and-events/ So now I have swipe, and can click the video to play it, and I also have custom buttons. Those are absolute positioned inside .ekko-lightbox wrapper div. Was still hoping to get swipe to work if they went over where the video was... It works on the backdrop and on the images, but not if the swipe across the area with the video in it. But at least they can play. When they fullscreen Youtube and exit it stays in the lightbox, but when they do the same in a Vimeo video it closes the lightbox.
$('.ekko-lightbox').addClass('hasButtons');
$('.ekko-lightbox, .embed-responsive iframe').swipeleft(function() {
});
|
I cannot detect swipe on any of the elements...
$('.ekko-lightbox *').swiperight(function() {
alert('ekko swiped');
$('.ekko-lightbox-nav-overlay .glyphicon-chevron-left').trigger("click");
});
$('.ekko-lightbox *').swipeleft(function() {
alert('ekko swiped');
$('.ekko-lightbox-nav-overlay .glyphicon-chevron-right').trigger("click");
});
`
The text was updated successfully, but these errors were encountered: