I need some help, I am trying to create a very simple jquery slider.. I want four divs to slide up when I click on a button. But I can not wrap my head around how to do this. Here is what I have in jsfiddle.net: http://jsfiddle.net/liveandream/LFAMW/
And here is my code:
<div id="slider">
<div class="slide1" style="background: red"></div>
<div class="slide2" style="background: green"></div>
<div class="slide3" style="background: black"></div><br clear="all">
</div>
<button id="prev">Previous</button>
<button id="next">Next</button>
JQUERY:
$("#next").click(function(){
$(".slide1").slideUp();
});
But I need them to automatically slide up to the next div on the next and previous click. Please any help would be greatly appreciated!
Are you trying something like this?
HTML:
Javascript:
CSS: