Gergely Mentsik
Gergely Mentsik

Reputation: 123

Bootstrap - pause Carousel

What I want to do is to pause my carousel when hovering with the mouse over ANOTHER div. I tried to use jQuery and .hover for this:

$('#running-box, #bg-car').carousel({})

    $("#running-box").hover(function(){
        $("bg-car").carousel({interval: false});
    });

But it isn't working. The reason I took interval:false is another post from here, also this won't work:

$('#running-box, #bg-car').carousel({})

    $("#running-box").hover(function(){
        $("bg-car").carousel('pause');
    });

I mastered every bootstrap stuff, fading transitions, affixing my menu but this simply won't work. Live Demo: http://mentsik.eu/kerek/

This is just a test site for testing Bootstrap. My Javascript is like in the examples, in an own applications.js

Upvotes: 1

Views: 8230

Answers (1)

lucuma
lucuma

Reputation: 18339

Assuming #running-box is the element you want to use as the hover target AND #bg-car is the one with the carousel, the following will work:

 $("#running-box").hover(
    function(){
        $("#bg-car").carousel('pause');
     },
    function() {
      $("#bg-car").carousel('cycle');
    }
  );

Please note your example has bg-car without a period or #.

Upvotes: 3

Related Questions