Animating my list-item
Animating my list-item
I have an unordered list as shown below and i am trying to make the list rotate. The script below rotates the list but only does it only when clicked on. However, is it possible to do this automatically, without the user having to click, if yes, how please?
<ul>
<li>menu1</li>
<li>menu2</li>
<li>menu3</li>
<li>menu4</li>
<li>menu5</li>
</ul>
<script>
$(function() {
$("li").click(function() {
var prev = $(this).prevAll();
$.unique(prev).each(function(i) {
$(this).delay(i*400).slideUp(function() {
$(this).appendTo(this.parentNode).slideDown();
});
});
});
});
</script>