views:

727

answers:

1

Hi,

Can anyone who may have used this plugin at: http://flowplayer.org/tools/scrollable.html know how to go about actaully removing a carousel pane from the carousel group.

As an example, if I have 5 carousel windows - how can I programmatically remove the carouosel window 2?

Any help would be much appreciated.

Thanks. Tony.

+2  A: 

Check this

To remove a particular tab use this function (slightly modified method from the example above):

function removeItem(i) { 
    // get handle to scrollable api 
    var api = $("div.scrollable").scrollable(); 

    // remove last item by using jQuery's remove() method 
    api.getItems().eq(i).remove(); 
}

removeItem(0); // will remove first item
removeItem(1); // will remove second
// etc.
RaYell
Thanks Ra Yell - have spent alot of time on this page but to no avail. This only demonstrates removing a pane only from the end. What if I want to remove pane number 2 from this example? Would appreciate if you could provide the code to do this as I haven't had much luck. Thanks.
tonsils
`api.getItems().eq(1).remove();` - this should remove second pane
RaYell
Thanks - will try it out and let you know.
tonsils
I had a go at this and from the looks of it, it actually took the carousel pane off at the end even though I indicated pane 2. Just wondering if you have had a chance in testing your code above?
tonsils
Yeah, I used firebug on this demo site: http://flowplayer.org/tools/demos/scrollable/edit.html then just typed `$('div.scrollable').scrollable().getItems().eq(1).remove();` and second pane was removed.
RaYell
Cool - can I ask you how you/where, you did this within Firebug, to test this?
tonsils
I just opened that site then typed the code in firebug's console.
RaYell
Thanks for your help.
tonsils