/* Initialize SlidesJS */
function currentSlide( current ) {
$(".current_slide").text(current + " of " + $("#top_slides").slides("status","total") );
}
$(function(){
/*
Initialize SlidesJS
*/
$("#top_slides").slides({
width: 1034,
height: 645
});
$("#slides").slides({
crossfade: true
});
$("#top_slides").slides({
navigateEnd: function( current ) {
currentSlide( current );
},
loaded: function(){
currentSlide( 1 );
}
});
/*
Play/stop button
*/
$(".top_controls").click(function(e) {
e.preventDefault();
// Example status method usage
var slidesStatus = $("#top_slides").slides("status","state");
if (!slidesStatus || slidesStatus === "stopped") {
// Example play method usage
$("#top_slides").slides("play");
// Change text
$(this).css({'background-image': 'url(../images/stop.png)'});
} else {
// Example stop method usage
$("#top_slides").slides("stop");
// Change text
$(this).css({'background-image': 'url(../images/play.png)'});
}
});
});