I am doing a fluid based slide show, for that, I written this code, issue is this animation starting correctly as well without the end, it's moving forward again.
I believe I am using the window.resize function, that would be the cause. if so how can i fix this?
my code :
var slideShow = function () {
var x = 0;
var imgHeight = $('img').height();
$('#slideContainer').height(imgHeight);
var imgSetWidth = $('#slideContainer').width();
$('img').width(imgSetWidth);
var imgLength = $('.slide').size();
$('.inner').css({width:imgLength * imgSetWidth,left:imgSetWidth*x});
$('a#next').click(function () {
x++;
$('.inner').animate({left:-imgSetWidth},1000);
} )
}
window.onload = function () {
slideShow();
};
$(window).resize(function () {
slideShow();
} )
As well if any one knows how to write the fluid based slide show (forward/previous) with title, let me know. try to avoid plug-ins.