Posted By

beso on 11/05/10


Tagged

css jquery Switch attr


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

laurentzziu


make a switcher


 / Published in: jQuery
 

useful for switching a play/stop button

  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  

You need to login to post a comment.