zurb / orbit

454 stars 96 forks source link

Is it possible to add images after the orbit is initialized? #90

Closed ringoma closed 12 years ago

ringoma commented 12 years ago

I am trying to create a dynamic slide which would change the images after button clicked. The images changed perfectly if the number of images is fixed. (The way is to prepare the fix number of ≤img≥ tag in #featured and replace the attr('src') dynamically.)

In addition, I would like to append / reduce the number of images. But the orbit could be only init once of the same div, is it possible to add images after the orbit is initialized? Or any ways to totally tear down the orbit-ed div and init the orbit in that div again?

Thanks :) Really much appreciate the plugin, robust and delicate.

ringoma commented 12 years ago

I found an ugly way to achieve what I want.

I just remove the old orbit-wrapper and append a new $('#featured').orbit() with appended the numbers of img. It works fine. Yet, I think it causes much memory to handle such remove and append repeating performance.

Appreciate if there is any elegant ways to propose.