Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shabda
Created December 12, 2011 09:10
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 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