Hi guys,
I have on my site a <div>
which contains child <div>
's. I want to make those children to slide into place like a content slider. I've tried a couple of different plugins, but they all failed because they tried to do some kind of DOM manipulation that just made things bad...
My own implementation is poor and seems to be having major performance issues.
So, I would like to know if anyone knows of a good content slider that isn't going to screw things up and one that hopefully has good documentation. Don't recommend bxSlider or easySlider, tried them and they failed, especially bxSlider.
Here's how the elements are structured:
<div class="Parent">
<div>
<h2>...</h2>
<ul>
<li>...</li>
</ul>
<p>...</p>
</div>
(Repeat)
</div>
Thanks in advance!
EDIT
I've rebuilt my implementation and it's working almost the way I want it to. The problem is that when it reaches the end of the list, it will slide backwards through all items really quick and then start over. Not sure exactly how to fix it. Would appreciate any suggestions!
var interval;
var Slider = function () {
var width = $(".Parent").width();
var count = $(".Children").size();
var margin = width;
var wrapper = $(".Wrapper");
var a = 0;
wrapper.css({
width: (width * count)
});
var interval = window.setInterval(function () {
if (margin == (width * count)) {
margin = 0;
a = 0;
} else {
margin = (width * a);
};
wrapper.animate({
marginLeft: ("-" + margin + "px")
}, 1000);
a++;
}, 6000);
};