Skip to content

Instantly share code, notes, and snippets.

@sydlawrence
Created June 20, 2011 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sydlawrence/1036897 to your computer and use it in GitHub Desktop.
Save sydlawrence/1036897 to your computer and use it in GitHub Desktop.
turntable.fm dj auto poll
var become_active = false;
var become_txt = $('<div>Waiting for DJ Slot</div>');
become_txt.css('position','fixed').css('bottom',0).css('left',0).css('z-index',9999).css('color','#fff');
$('body').append(become_txt);
var _oldhide = $.fn.hide;
$.fn.hide = function(speed, callback) {
if ($(this).hasClass('become_dj')) {
become_active = false;
}
return _oldhide.apply(this,arguments);
}
var _oldshow = $.fn.show;
$.fn.show = function(speed, callback) {
if ($(this).hasClass('become_dj')) {
become_active = true;
$('.become_dj').click();
become_txt.html('You should now be dj');
}
return _oldshow.apply(this,arguments);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment