I have tried moving last element in my list to first position on click, but it does not work. I did it according to answer from this question: Move last child to first position . Firebug shows me that something happens with the list, but it's certainly not last to first change :(
jQuery:
$(document).ready(function(){
$(".carousel-button-left").click(function(){
var $ul=$(this).next();
var $lastchild=$ul.children().last();
$ul.prepend($lastchild);
});
});
HTML:
<div class="testowyDiv">
<img class="carousel-button-left" src="ikony/strzalkal.png">
<div class="testowyDiv2">
<ul class="testowyUl">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
</ul>
</div>
<img class="carousel-button-right" src="ikony/strzalkap.png">
</div>