Skip to content

Instantly share code, notes, and snippets.

@kevinold
Created September 18, 2009 21:56
Show Gist options
  • Select an option

  • Save kevinold/189318 to your computer and use it in GitHub Desktop.

Select an option

Save kevinold/189318 to your computer and use it in GitHub Desktop.
jquery.droppy patch to keep item "sticky"
# Patch to keep top menu item "sticky" if when you want it to be so
# <li class="hover sticky"><a href="#"></a></li>
diff --git a/public/javascripts/jquery.droppy.js b/public/javascripts/jquery.droppy.js
index 13fda9c..ed85e25 100644
--- a/public/javascripts/jquery.droppy.js
+++ b/public/javascripts/jquery.droppy.js
@@ -64,7 +64,7 @@
$('li', this).hover(
function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
- function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }
+ function() { if (!$(this).hasClass('sticky')) { $(this).removeClass('hover'); $('> a', this).re
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment