richardscarrott / jquery-ui-carousel

jQuery RS Carousel is a responsive and touch-enabled carousel written on top of jQuery and the jQuery UI Widget Factory providing a full and familiar API in less than 2.6kB minified and gzipped.
http://richardscarrott.github.io/jquery-ui-carousel/
192 stars 56 forks source link

autoScroll and pause on hover(mouse out) no reset time #34

Closed dexterns88 closed 12 years ago

dexterns88 commented 12 years ago

when autoScroll on and pause set to some value on mouse out from slider timer for pause don't reset . Can you add setting for reset pause time on 0 when mouse out from slider. thx.

dexterns88 commented 12 years ago

sorry. Reset time work on hover but when click on pagination interval doesn't reset and slide on next very fast.

dexterns88 commented 12 years ago

i write fast solution for this bug. In library jquery.rs.carousel-autoscroll add-ed next code

This is added function _paginatioCleanTime: function() { var pagLoc = $('body').find('.rs-carousel-pagination'); pagLoc.find('li') .bind('click.' + this.widgetName, $.proxy(this, '_stop')) .bind('click.' + this.widgetName, $.proxy(this, '_start')); }

and in '_create: function() ' i call my function affter function this._start(); this._paginatioCleanTime();

richardscarrott commented 12 years ago

I'm unable to reproduce this bug using v0.8.6. Can you provide a link I can take a look at to see the issue?

If I were to hazard a guess at what you're doing it looks like you're inserting the pagination into another part of the DOM (i.e. not within the wrapping .rs-carousel element)? If this is the case I'd recommend binding your own hover events in the create callback like this:

$('.rs-carousel').carousel({
    create: function () {

          var el = $(this);

          // this selector needs to uniquely select this pagination element
          // in cases where multiple carousels are on one page
          $('.rs-carousel-pagination')
              .bind('mouseenter', function () {
                  el.carousel('option', 'autoScroll', false);
               })
               .bind('mouseleave', function () {
                  el.carousel('option', 'autoScroll', true);
               });
    }
});
richardscarrott commented 12 years ago

Cannot reproduce.