Welcome to the jKit community. This is the place to discuss everything on and around jKit. Be friendly and I’m sure other members will be friendly with you, too.
Carousel : problems at limits
  • Set the parameters of components in a data attribute is a great idea. Thank you for JKit!

    Carousel is not working properly when limit is equal to or greater than the number of children. And transitions are not perfect in the reverse direction.

    To fix these two bugs, I propose to hide the block outgoing, then move the block entering and show it. My changes are in line 2909 and the following:

    if (!isAnimated) {

    var pos = Math.min(options.limit, $el.children().length);

    if (dir == ‘next’ || dir == undefined) {

    plugin.triggerEvent('shownext', $el, options);
    $el.children(':first-child').jKit_effect(false, options.animation, options.speed, options.easing, 0, function(){
      $el.append($el.children(':nth-child(1)'));
      $el.children(':nth-child('+pos+')').jKit_effect(true, options.animation, options.speed, options.easing, 0);
    });
    

    } else if (dir == ‘prev’) {

    plugin.triggerEvent('showprev', $el, options);
    $el.children(':nth-child('+pos+')').jKit_effect(false, options.animation, options.speed, options.easing, 0, function(){
      $el.prepend( $el.children(':last-child') );
      $el.children(':first-child').jKit_effect(true, options.animation, options.speed, options.easing, 0);
    });     
    

    } }

  • Thx for the bug report, will look into it later today.

    Creator of jKit – www.fredibach.ch
  • Thx again, especially for the code, it’s now in the latest version together with some other small fixes (v1.1.11).

    Creator of jKit – www.fredibach.ch