thanks friend,you saved my life

I appreciate you...



PaulMWatson wrote:
> 
> I can't give you actual code as it is in a work project but here is how it
> goes.
> 
> First your HTML, just the wrapper really:
> 
> <div class="wrapper">
> </div>
> 
> Then your JS:
> 
> function loadCarousel()
> {
>   // Destroy contents of wrapper
>   $('.wrapper *').remove();
>   // Create UL list
>   $('.wrapper').append('<ul id="carousellist"></ul>')
>   // Load your items into the carousellist
>   for (var i = 0; i < 10; i++)
>   {
>     $('#carouselist').append('<li>Item ' + i + '</li>');
>   }
>   // Now apply carousel to list
>   jQuery('#carousellist').jcarousel({ // your config });
> }
> 
> So everytime you want to create the carousel list you just call that and
> make sure it destroys the contents of the wrapper, then you insert your
> items and then you apply the carousel.
> 
> Not the best code, but it works.
> 
> 
> phplord wrote:
>> 
>> May I see your sample code please...
>> 
>> tHanks for your reply
>> 
>> PaulMWatson wrote:
>>> 
>>> I ran into the same problem. My simple solution is to destroy everything
>>> jCarousel creates in the DOM, create your UL/LI list again and run
>>> .jcarousel against the new list. It is like a reinit.
>>> 
>>> The way I handled the destroying was to wrap my UL/LI in a wrapper div
>>> and destroy everything inside it. Works fine though probably not the
>>> most elegant solution.
>>> 
>>> 
>>> hxela wrote:
>>>> 
>>>> Initially my carousel loads /foo and is fed data from the database in
>>>> order to build the carousel.
>>>> 
>>>> I'd like the user to be able to click on a link /foo?search=bar and
>>>> have the carousel update with the new data.
>>>> 
>>>> Any ideas? Would I have to destroy the carousel and re-create it
>>>> passing in a new url? If so.. any ideas how?
>>>> 
>>>> Any help greatly appreciated!
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Dynamically-modifying-the-content-of-the-carousel-tf3253484.html#a9367251
Sent from the jCarousel mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to