Codeinwp / Ideal-Image-Slider-JS

Quite simply the ideal Image Slider in vanilla JS.
http://idealimageslider.com
GNU General Public License v3.0
1.57k stars 160 forks source link

Allow clients to add images dynamically #40

Closed acechase closed 9 years ago

acechase commented 9 years ago

This is mostly an extract refactor where the individual slide creation logic is pulled into a makeSlide method. This is done to allow for the addition of an addSlide method that can be called by Slider clients.

I'm currently using the functionality from my client code like this:

  // a user has just uploaded a new image that should be added as the first slide
  var slider = that.get('slider'); // this is an ember.js idiom to fetch the slider object 
  var slideElement = document.createElement('img');
  slideElement.setAttribute('data-src', imageURL);
  slider.addSlide(slideElement, true);
  slider.gotoSlide(1);
gilbitron commented 9 years ago

If you are willing to sort the spacing so it matches the existing file I'm willing to test and merge this.

acechase commented 9 years ago

woah! 8 space tabs!!! ;-)

My team wound up finding it easier to implement our own slider functionality to cover all the various scenarios we wanted customization over. I'll go ahead and close this pull request.

Cheers, Andrew