How do i fire a click continuously while something is hovered?

后端 未结 4 697
长发绾君心
长发绾君心 2021-01-07 10:01

Im pretty sure this has a simple solution. I am using jCarousellite, and i want to change the behaviour of built in nav buttons to fire on hover over.

$(\"#         


        
4条回答
  •  借酒劲吻你
    2021-01-07 10:48

    var nav = function() {
      $("#carousel .btn-down").click(); // next move
      $("#carousel").data(
        'hover', 
        window.setTimeout(nav, 1000); // continue in 1000 ms
      );
    };
    $("#carousel .btn-down").hover(
      nav,
      function() {
        window.cancelTimeout ($("#carousel").data('hover')); // stop the navigation
      }
    );
    

提交回复
热议问题