make a switcher


/ Published in: jQuery
Save to your folder(s)

useful for switching a play/stop button


Copy this code and paste it in your HTML
  1. var file = $("#a_audio").attr("href");
  2. $('#a_audio').bind("click", function(){
  3. if ($(this).attr("class") == "off") {
  4. $(this).attr("class", "on");
  5. $("#a_audio").attr("href", file);
  6. }
  7. else {
  8. $(this).attr("class", "off");
  9. $("#a_audio").attr("href", "javascript:deletePlayer('musicwrapper', 'jw52', 'player1');");
  10. }
  11. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.