Skip to content

Instantly share code, notes, and snippets.

@rlemon
Created January 16, 2013 18:28
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 rlemon/4549488 to your computer and use it in GitHub Desktop.
Save rlemon/4549488 to your computer and use it in GitHub Desktop.
Simple sidebar toggle userscript for the SO Chat system
$('.sidebar-widget').each(function() {
var container = $('<div></div>'),
btn = $('<button></button>'),
that = this;
btn.text('toggle');
btn.on('click', function() {
$(that).toggle();
});
container = $(this).wrap(container);
$(this.parentNode).append(btn);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment