My jquery image slider is not smooth in chrome, but works fine in firefox and IE

So, I have this very simple image slider on this page here http://charlesbergertattoos.com/tattoos , which works fine in IE and firefox. The animation is really smooth, and the images are actually slides, but in chrome it is not smooth at all.

+6
source share
2 answers

because when you click on an event, your call to slider_animate() will not directly call your plugin

in chrome, when you do this, slide_widths var is 0 because you defined and executed the destination logic outside the event function, therefore its static

you have 2 options that put this line inside the slider_animate function

 var slide_widths = $(e).find('.holder > li:first').width(); //correct the variables name accordingly 

or call the function of the plugin itself, which imgSlider

+5
source

Well in caraousel.js there is no line. 32

try using something synonymous with the following code instead, I mean that the .animate () call should be something like animate ({marginLeft: "233px"})

 $('.browse.button.next.right').parent().find('.holder').children('li').eq('0').animate({marginRight: "-233px"}); 

it will work like the previous click

 $('.browse.button.next.right').parent().find('.holder').children('li').eq('0').animate({marginLeft: "233px"}) 

this will work with the next click

and these syntaxes work in both chrome and firefox ..

0
source

Source: https://habr.com/ru/post/912320/


All Articles