Skip to content

Instantly share code, notes, and snippets.

@robrocker7
Created October 22, 2010 18:12
Show Gist options
  • Save robrocker7/641073 to your computer and use it in GitHub Desktop.
Save robrocker7/641073 to your computer and use it in GitHub Desktop.
Code that was being used is commented out, new code is below
/*
$('#home_testimonials a.wpaudio').bind('click', function() {^M
if ($(this).hasClass('clicked')) {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_listen_home.png)');^M
$(this).removeClass('clicked');^M
} else {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_pause.png)');^M
$(this).addClass('clicked');^M
}^M
});^M
^M
$('#testimonial_columns a.wpaudio').bind('click', function() {^M
if ($(this).hasClass('clicked')) {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_listen_testimonials.png)');^M
$(this).removeClass('clicked');^M
} else {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_pause.png)');^M
$(this).addClass('clicked');^M
}^M
});^M
^M
$('#sidebar_testimonials .listen a.wpaudio').bind('click', function() {^M
if ($(this).hasClass('clicked')) {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_listen_sidebar.png)');^M
$(this).removeClass('clicked');^M
} else {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_pause.png)');^M
$(this).addClass('clicked');^M
}^M
});^M
^M
$('#testimonial_list .testimonial .listen').bind('click', function() {^M
if ($(this).hasClass('clicked')) {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_listen_testimonials.png)');^M
$(this).removeClass('clicked');^M
} else {^M
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_pause.png)');^M
$(this).addClass('clicked');^M
}^M
});^M
*/
$('.wpaudio').click(function() {
current_image = $(this).css('background-image');
$('.wpaudio').css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_listen_testimonials.png)');
if(current_image.match(/icon_pause/)){
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_listen_testimonials.png)');
} else {
$(this).css('background-image', 'url(<?php bloginfo("template_directory"); ?>/images/icon_pause.png)');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment