Not Able yo Add Previous Function(Slide Back) to Simple jQuery Slider

Not Able yo Add Previous Function(Slide Back) to Simple jQuery Slider

Can you please take a look at this demo and let me know how I can enable previous button to slide to? as you can see the next button is working fine but I am not able to slide back

  1. $("#slideshow > div:gt(0)").hide(); $("#next").on("click", function(){ $('#slideshow > div:first') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }); $("#prev").on("click", function(){ $('#slideshow > div:prev') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); });

  <button id="next"> next</button>
 <button id="prev"> prev</button> <div id="slideshow"> <div> <img src="http://farm6.static.flickr.com/5224/5658667829_2bb7d42a9c_m.jpg"> </div> <div> <img src="http://farm6.static.flickr.com/5230/5638093881_a791e4f819_m.jpg"> </div> <div> Pretty cool eh? This slide is proof the content can be anything. </div> </div>