Here Below is the code:
<script>
$(document).ready( function($){
var slider = $('.slider').find('ul');
var transition = 2500;
$( slider ).find('li.active').show();
window.slider = {
previous: function(){
var current = $( slider ).find( 'li.active' );
var prevElement = $( current ).prev('li');
if( prevElement.length != 0 ){
$( current ).removeClass('active').fadeOut( transition );
$( prevElement ).addClass('active').fadeIn( transition );
}
},
next: function(){
var current = $( slider ).find( 'li.active' );
var nextElement = $( current ).next('li');
if( nextElement.length != 0 ){
$( current ).removeClass('active').fadeOut( transition );
$( nextElement ).addClass('active').fadeIn( transition );
}
}
}
});
</script>
How Can I go about making the pictures automate themselves?