Grow your CSS skills. Land your dream job.

An issue on carousel slider hover

  • # March 8, 2013 at 7:23 pm

    Hello to everyone!

    I have created a carousel slider here:

    http://jsfiddle.net/VUfzq/

    If you see I have added an auto rotate of 1000 to automaticely change every 1 second.

    The problem I have is when I hover on items the auto rotate stops and doesn’t work even I move my cursor to anywhere else.

    What can I do to fix this problem?

    Thanks in advance!

    Alireza.M

    # March 8, 2013 at 7:47 pm

    Try to add the mouseleave (second) event handler to carousel.js line 407:

    .bind(‘mouseenter click touchstart’, function() {
    clearInterval(auto);
    })
    .bind(‘mouseleave’, function() {
    auto = setInterval(autoAdvance, speed);
    });

    # March 8, 2013 at 7:54 pm

    Thank you so much CrocoDillon!

    It’s working very well now.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".