question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

carousel is sliding on ios when clicking whitout controls

See original GitHub issue

Hi there,

I’ve an issue I can’t understand using the bootstrap carousel. On mobile, I want to slide by swiping (and not clicking), and, on click, a pinterest button appears. I’ve desactivated the carousel control buttons on mobile device (see css code below) and have a jquery rule to the pinterest button, It works perfectly on android. But on ios, on click, the carousel is sliding.

Any idea ?

My code

<div id="carouselwork" class="carousel slide work-single" data-ride="carousel" data-interval="false">
                    <div class="carousel-inner">
                        <div class="carousel-item  active">
                             <img src="..." alt="..." />
                             <div class="social-sharing ss-social-sharing" >
				   <a onclick="return ss_plugin_loadpopup_js(this);" rel="external nofollow" class="ss-button-pinterest" href="..." target="_blank"></a>
                             </div>
                             <div class="img-work-caract">
                                 <p>the title</p>
                                 <div class="counter">1/<span class="total">2</span>
                                 </div>
                            </div>
                        </div>
                        <div class="carousel-item">
                            <img src="..." alt="..." />
                             <div class="social-sharing ss-social-sharing" >
				  <a onclick="return ss_plugin_loadpopup_js(this);" rel="external nofollow" class="ss-button-pinterest" href="..." target="_blank"></a>
                             </div>
                             <div class="img-work-caract">
                                 <p>the title</p>
                                 <div class="counter">2/<span class="total">2</span>
                                 </div>
                            </div>
                        </div>
                    </div>
                    <a class="carousel-control-prev carousel-control" href="#carouselwork" role="button" data-slide="prev"></a>
                    <a class="carousel-control-next carousel-control" href="#carouselwork" role="button" data-slide="next"></a>
                </div>

and css

@media (max-width: 768px) {
        .social-sharing.visible {
            display: block;
        }
        .carousel-control {
            display: none;
        }
    }

and jquery :

$('.carousel-item img').click(function() {
     $('.social-sharing').toggleClass('visible'); });
$("#carouselwork").on('slide.bs.carousel', function () {
       $('.social-sharing').removeClass('visible');
 });

Thanks !

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
patrickhlaukecommented, Mar 25, 2019

what @happy-dev means is that on iOS, when you just tap on the carousel, it also slides, which i can confirm. i’d hazard a guess that it’s because a clean tap still generates one sacrificial touchmove event, which our curstom sliding script may be picking up. on android, it likely follows the pointer events path (from memory, we implemented that, right? not checked in a while) where this doesn’t happen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bootstrap carousel is sliding on ios when clicking whitout ...
On mobile, I want to slide by swiping (and not clicking), and, on click, a pinterest button appears. I've desactivated the carousel control ......
Read more >
Carousels on Mobile Devices - Nielsen Norman Group
Using swipe to control the carousel creates the problem of swipe ambiguity on iOS. Swipe ambiguity refers to the fact that the same...
Read more >
Switch an app window to a Slide Over window on iPad
Open an app in Slide Over. While using an app, tap the Multitasking Controls button at the top of the screen, then tap...
Read more >
Carousel | How-to - UXPin
5. In Animation settings, set Delay to 2000ms. Otherwise the first slide will advance too quickly to the second one without being seen....
Read more >
Designing A Perfect Carousel UX - Smashing Magazine
Hence, users rarely click through the slides of carousels, especially if the very first slide isn't enticing enough or has no connection ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found