Skip to content

Instantly share code, notes, and snippets.

@vlazzle
Created September 22, 2011 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlazzle/1233839 to your computer and use it in GitHub Desktop.
Save vlazzle/1233839 to your computer and use it in GitHub Desktop.
bookmarklet to loop a track in soundcloud
(function($)%20{var%20$play%20=%20$(%27.controls%20a.play:first%27),poll%20=%20true;function%20startPolling()%20{setInterval(function()%20{if%20(poll)%20{if%20(!$play.hasClass(%27playing%27))%20{$play.trigger(%27click%27,%20true);}}},%20500);}$play.bind(%27click%27,%20function(e,%20loop)%20{if%20(typeof%20loop%20===%20%27undefined%27%20||%20!loop)%20{poll%20=%20!$play.hasClass(%27playing%27);}});startPolling();}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment