Answer the question
In order to leave comments, you need to log in
jquery, animate not applied for hidden slider?
There is a simple script that organizes the slider. Looks something like this
function slider_init(name){<br>
var animate_period = 300;<br>
var id = '#' + name + ' ';<br>
var slider_element_width = $(id + 'ul li:first').outerWidth(true);<br>
$(id + '.prev').click(function(e){<br>
e.preventDefault();<br>
$(id + 'li:last-child').prependTo(id + 'ul');<br>
$(id + 'ul').css('left', -slider_element_width + 'px');<br>
$(id + 'ul').animate({ 'left': '0px' } , animate_period);<br>
});<br>
$(id + '.next').click(function(e){<br>
e.preventDefault();<br>
$(id + 'li:first-child').appendTo(id + 'ul');<br>
$(id + 'ul').css('left', '0px');<br>
$(id + 'ul').animate({ 'left': -slider_element_width + 'px'} , animate_period);<br>
});<br>
}<br>
Answer the question
In order to leave comments, you need to log in
An error in calculating coordinates is possible - you need to look at the entire code.
What kind of blocks do you have (with fixed not fixed width), what container of blocks?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question