Skip to content

Instantly share code, notes, and snippets.

@shabda
Created December 12, 2011 09:10
Show Gist options
  • Save shabda/1466098 to your computer and use it in GitHub Desktop.
Save shabda/1466098 to your computer and use it in GitHub Desktop.
$.fn.toggleStuff = ->
$this = $(this)
anchorCss =
position: 'fixed'
top: '30px'
right: '10px'
'z-index': '999'
'font-size': '30px'
'font-weight': 'bold'
'text-decoration': 'none'
anchor = $("<a>").text('▼').css(anchorCss).addClass("dotjsToggler").prependTo("body")
upUp = ->
$this slideUp
anchor.text '▲'
downDown = ->
$this slideDown
anchor.text '▼'
anchor.toggle(upUp, downDown).click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment