views:

175

answers:

1

I am using JCarousel to display some ads.

Everything works fine, except when there is no ads, ie JCarousel has zero content. This will cause the Next Button to be active, as if there where unlimited items inside the carousel. I haven't altered any code at all, just the css for the colors and attributes.

Does anybody know what I am talking about, or anyone who can help me fixing it...?

Otherwise I will replace it with some other Jquery Carousel plugin!

Thanks

+1  A: 

you will need to detect the presence of the adds and then disable the button if there are none. You can do all this from the API. I would probably pass this functionalit in as part of the init callback.

eaxmple:

$('#ad-continer').jcarousel({initCallback: 
  function(carousel, state){
    if($(carousel.list).length < 1){
       // set next and previous to disabled.
    }
  }
});

Youll need to look at the source for jcarousel to see what the other methods are you can call i know there is a way to disable the controls independently though. and there are actually a lot of options you can pass in not just 2... http://sorgalla.com/projects/jcarousel/#Configuration

prodigitalson
could you give me some more specific information please, I would appreciate it! How do you mean? I have the basic variables which I can set in the beginning, do you mean those?
Camran
I think I know what you mean, but I don't have the skills to do it... I am making another Q to see if anyone (maybe you) could help me writing this, cuz it would save me alot of time! Very thankful for you detailed answer :)
Camran