nir9 / itemslide

JavaScript Touch Carousel Library with Zero Dependencies
https://itemslide.org
MIT License
647 stars 85 forks source link

Feature: Reposition on window resize (without .reload()) #57

Open artemsky opened 8 years ago

artemsky commented 8 years ago

Hi. I am pretty sure that you need to add "reposition" event.

Explaining why:

At my webapp, by selecting slider item its load content to another window, which has an ifarme inside (youtube video). 1st i tried to use Slider.reload() on window.resize() event But i met a problem after i opened my video at full screen. It called window.resize() event. And slider did reload, and my ifame with my video just gone.

So i found solution by myself, and hope you add this event, because i like your lib!

let width = 0; this.Slider.find("li").each(function(){ width+= $(this).outerWidth(); }); this.Slider.css("transform",translate3d(($(window).width() - width - this.Slider.find(".itemslide-active").outerWidth())/2 + "px, 0px, 0px)");`

DarioLopes commented 7 years ago

Same here