jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
1.99k stars 736 forks source link

jCarousel : automatic prev/next bug #25

Closed Dupond closed 14 years ago

Dupond commented 14 years ago

Hello, I have 4 carousels on my homepage. They are set with like this : jQuery(document).ready(function() { jQuery('#carousel-lastposts').jcarousel({ scroll: 1, animation: 0, buttonPrevHTML: '<', buttonNextHTML: '>' }); jQuery('#carousel-lastcomments').jcarousel({ scroll: 1, animation: 0, buttonPrevHTML: '<', buttonNextHTML: '>' }); jQuery('#carousel-lastevents').jcarousel({ scroll: 1, animation: 0, buttonPrevHTML: '<', buttonNextHTML: '>' }); jQuery('#carousel-lastimages').jcarousel({ scroll: 4, buttonPrevHTML: '<', buttonNextHTML: '>', itemLoadCallback: carousel_lastimages_itemLoadCallback }); });

If I replace default controls with external controls, it works like a charm... But using default controls doesn't work at all : for example, the first carousel has 6 items ; if I click on the "next" button, I see item #6. And if I click on the "previous" button, it scrolls to #1... Now it's not a CSS problem, since I've tried to disable CSS, and the problem is the same (I mean : for example the "next" button is set to "disabled='true'" as soon as I click on it, whereas it shouldn't since there are 6 items to scroll...) So.. maybe this is a bug ? Thanx very much for your help, Dupond

jsor commented 14 years ago

Could you provide a link where i can see the code?

Dupond commented 14 years ago

Unfortunately, the site is offline (I'm testing it for the moment).

The HTML looks like this :

Commentaires récents

I hope this helps... If you need the generted code (I mean : the source code including the code added by jCarousel), please let me know.

Thanx for your help !

Dupond commented 14 years ago

Mmmm... The code has been converted ! Let's try again : [code]

Commentaires récents

<ul id="carousel-lastcomments">
    <li>
        <ul>
            <li><span class="left"><a href="/post/2010/04/17/Phasellus-latinus#c652">Paul : strange day</a></span><span class="right">10.04.17</span></li>
            <li>blablabla [<- same code as before, in fact]</li>
            <li>blablabla [<- same code as before, in fact]</li>
            <li>blablabla [<- same code as before, in fact]</li>
            <li>blablabla [<- same code as before, in fact]</li>
        </ul>
    </li>
    <li>
        <ul>
            <li>blablabla</li>
            <li>blablabla</li>
            <li>blablabla</li>
            <li>blablabla</li>
            <li>blablabla</li>
        </ul>
    </li>
</ul>

[/code]

jsor commented 14 years ago

I need a complete page with all stuff in it.

Dupond commented 14 years ago

I have put it online. You can see it here : http://sxjpl.free.fr/blog2/ Click on any "Prev" or "Next" text links, and you'll see what the trouble is :)

jsor commented 14 years ago

I've seen that you're using version 0.2.3. The latest version is 0.2.5. Could you please try with the latest version?

http://github.com/jsor/jcarousel/downloads

Dupond commented 14 years ago

Done. But as you can, nothing has changed. The problem is exactly the same...

Dupond commented 14 years ago

as you can SEE...

jsor commented 14 years ago

I committed a patch yesterday which should fix the bug. Could you try the latest dev version: http://github.com/jsor/jcarousel/blob/0.2/lib/jquery.jcarousel.min.js

Dupond commented 14 years ago

Thank you very much. It works great now.

But why is version 0.2.5 twice as big as the 0.2.3 one ? That's why I use jCarousel 0.2.3 instead. Would it be possible to include the patch in the 0.2.3 version ? Thanx in advance ! Best regards, Dupond

jsor commented 14 years ago

0.2.3 is packed, while 0.2.5 is minified. Just pack 0.2.5 yourself with http://dean.edwards.name/packer/