Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript An issue on carousel slider hover

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43255
    AlirezaM
    Participant

    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

    #127542
    CrocoDillon
    Participant

    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);
    });

    #127544
    AlirezaM
    Participant

    Thank you so much CrocoDillon!

    It’s working very well now.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.