jQuery: The Write Less, Do More JavaScript Library

Changed attributes on <div>. Now I get no event

View: New views
4 Messages — Rating Filter:   Alert me  

Changed attributes on <div>. Now I get no event

by CoffeeAddict :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


for the JCarousel (http://sorgalla.com/projects/jcarousel/), I
attempted to keep my next button enabled.  Currently, it only becomes
enabled if you have more items (images) added to the carousel than
it's currently showing (visible when you look at the carousel).

For us, we want to be be abe to control this because I don't want to
have to add an extra item(s) just to get the button to be clickable so
that we can load the next set of images.

So I tried this:

    jQuery(document).ready(function()
    {
        $('#mycarousel').jcarousel({
        itemLoadCallback: mycarousel_itemLoadCallback
        });
    });

    function mycarousel_nextItemCallback()
    {
        jQuery(".jcarousel-next").attr({ disabled: "false" });
        jQuery(".jcarousel-next").removeClass("jcarousel-next-
disabled");
        jQuery(".jcarousel-next").removeClass("jcarousel-next-disabled-
horizontal");

        jQuery('#jcarousel-next').bind('click', function() {
            carousel.next();
            return false;
        });
    };

everything seems to work out fine.  Except when I click on the next
button that appears enabled on first load (even if I did not specify a
size > than what is showing), nothing happens.  It's like it doesn't
know that div or something exists.

Re: Changed attributes on <div>. Now I get no event

by CoffeeAddict :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


posting error, should be itemLoadCallback:
mycarousel_nextItemLoadCallback which is what I have currently.

On Jul 2, 3:23 pm, expresso <dschin...@...> wrote:

> for the JCarousel (http://sorgalla.com/projects/jcarousel/), I
> attempted to keep my next button enabled.  Currently, it only becomes
> enabled if you have more items (images) added to the carousel than
> it's currently showing (visible when you look at the carousel).
>
> For us, we want to be be abe to control this because I don't want to
> have to add an extra item(s) just to get the button to be clickable so
> that we can load the next set of images.
>
> So I tried this:
>
>     jQuery(document).ready(function()
>     {
>         $('#mycarousel').jcarousel({
>         itemLoadCallback: mycarousel_itemLoadCallback
>         });
>     });
>
>     function mycarousel_nextItemCallback()
>     {
>         jQuery(".jcarousel-next").attr({ disabled: "false" });
>         jQuery(".jcarousel-next").removeClass("jcarousel-next-
> disabled");
>         jQuery(".jcarousel-next").removeClass("jcarousel-next-disabled-
> horizontal");
>
>         jQuery('#jcarousel-next').bind('click', function() {
>             carousel.next();
>             return false;
>         });
>     };
>
> everything seems to work out fine.  Except when I click on the next
> button that appears enabled on first load (even if I did not specify a
> size > than what is showing), nothing happens.  It's like it doesn't
> know that div or something exists.

Re: Changed attributes on <div>. Now I get no event

by CoffeeAddict :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


one more time:

    jQuery(document).ready(function()
    {
        $('#mycarousel').jcarousel({
        itemLoadCallback: mycarousel_itemLoadCallback,
        buttonNextCallback:  mycarousel_nextItemCallback
        });
    });

On Jul 2, 3:23 pm, expresso <dschin...@...> wrote:

> for the JCarousel (http://sorgalla.com/projects/jcarousel/), I
> attempted to keep my next button enabled.  Currently, it only becomes
> enabled if you have more items (images) added to the carousel than
> it's currently showing (visible when you look at the carousel).
>
> For us, we want to be be abe to control this because I don't want to
> have to add an extra item(s) just to get the button to be clickable so
> that we can load the next set of images.
>
> So I tried this:
>
>     jQuery(document).ready(function()
>     {
>         $('#mycarousel').jcarousel({
>         itemLoadCallback: mycarousel_itemLoadCallback
>         });
>     });
>
>     function mycarousel_nextItemCallback()
>     {
>         jQuery(".jcarousel-next").attr({ disabled: "false" });
>         jQuery(".jcarousel-next").removeClass("jcarousel-next-
> disabled");
>         jQuery(".jcarousel-next").removeClass("jcarousel-next-disabled-
> horizontal");
>
>         jQuery('#jcarousel-next').bind('click', function() {
>             carousel.next();
>             return false;
>         });
>     };
>
> everything seems to work out fine.  Except when I click on the next
> button that appears enabled on first load (even if I did not specify a
> size > than what is showing), nothing happens.  It's like it doesn't
> know that div or something exists.

Re: Changed attributes on <div>. Now I get no event

by ricardobeat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Do a check when you reach the end and then add new items, that way you
preload the images and the next/prev buttons stay enabled. See the
"circular carousel" example: http://sorgalla.com/projects/jcarousel/examples/special_circular.html

On Jul 2, 5:23 pm, expresso <dschin...@...> wrote:

> for the JCarousel (http://sorgalla.com/projects/jcarousel/), I
> attempted to keep my next button enabled.  Currently, it only becomes
> enabled if you have more items (images) added to the carousel than
> it's currently showing (visible when you look at the carousel).
>
> For us, we want to be be abe to control this because I don't want to
> have to add an extra item(s) just to get the button to be clickable so
> that we can load the next set of images.
>
> So I tried this:
>
>     jQuery(document).ready(function()
>     {
>         $('#mycarousel').jcarousel({
>         itemLoadCallback: mycarousel_itemLoadCallback
>         });
>     });
>
>     function mycarousel_nextItemCallback()
>     {
>         jQuery(".jcarousel-next").attr({ disabled: "false" });
>         jQuery(".jcarousel-next").removeClass("jcarousel-next-
> disabled");
>         jQuery(".jcarousel-next").removeClass("jcarousel-next-disabled-
> horizontal");
>
>         jQuery('#jcarousel-next').bind('click', function() {
>             carousel.next();
>             return false;
>         });
>     };
>
> everything seems to work out fine.  Except when I click on the next
> button that appears enabled on first load (even if I did not specify a
> size > than what is showing), nothing happens.  It's like it doesn't
> know that div or something exists.