$(document).ready(function() { $('.lyrics_box').cycle({ fx: 'fade', cssFirst: { width: 800 }, cssBefore:{ width: 800 }, cssAfter:{ width: 800 }, timeout: 0, random: true, next: ".next", prev: ".prev", before: function(){ $(this).parent().find('audio.current').removeClass(); }, after: function(){ $(this).children("audio").addClass('current'); } }); });