/* * project: twitter bootstrap hover dropdown * author: cameron spear * contributors: mattia larentis * * dependencies?: twitter bootstrap's dropdown plugin * * a simple plugin to enable twitter bootstrap dropdowns to active on hover and provide a nice user experience. * * no license, do what you want. i'd love credit or a shoutout, though. * * http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/ */(function(e,t,n){var r=e();e.fn.dropdownhover=function(n){r=r.add(this.parent());return this.each(function(){var n=e(this).parent(),i={delay:500,instantlycloseothers:!0},s={delay:e(this).data("delay"),instantlycloseothers:e(this).data("close-others")},o=e.extend(!0,{},i,o,s),u;n.hover(function(){o.instantlycloseothers===!0&&r.removeclass("open");t.cleartimeout(u);e(this).addclass("open")},function(){u=t.settimeout(function(){n.removeclass("open")},o.delay)})})};e('[data-hover="dropdown"]').dropdownhover()})(jquery,this);