Skip to content

Instantly share code, notes, and snippets.

View AMHOL's full-sized avatar

Andy Holland AMHOL

  • Manchester, UK
  • 21:04 (UTC +01:00)
View GitHub Profile
@AMHOL
AMHOL / Category drop-down
Created November 8, 2012 15:09
Create recursive category drop-down navigation by assigning data('children') to navigation li and calling elem.createDropdownFromChildren
(($) ->
$.fn.createDropdownFromChildren = ($level) ->
$elem = $(@)
# if element has children data
unless @data("children") is "undefined"
@bind
# MOUSE ENTER
mouseenter: ->
clearTimeout $(document).data("dd-timeout")