diff --git a/README.md b/README.md index 0708e27..cb5292c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ menu-aim is a jQuery plugin for dropdown menus that can differentiate between a user trying hover over a dropdown item vs trying to navigate into a submenu's contents. -[Try a demo.](http://htmlpreview.github.com/?https://github.com/kamens/jQuery-menu-aim/blob/master/example/example.html) +[Try a demo.](https://rawgithub.com/kamens/jQuery-menu-aim/master/example/example.html) ![Amazon screenshot](https://raw.github.com/kamens/jQuery-menu-aim/master/amazon.png) @@ -72,7 +72,7 @@ dropdown item *and* when that item is being intentionally hovered over. ## Want an example to learn from? -Check out example/example.html -- it has [a working dropdown for you to play with](http://htmlpreview.github.com/?https://github.com/kamens/jQuery-menu-aim/blob/master/example/example.html): +Check out example/example.html -- it has [a working dropdown for you to play with](https://rawgithub.com/kamens/jQuery-menu-aim/master/example/example.html): ![Example screenshot](https://raw.github.com/kamens/jQuery-menu-aim/master/example.png)
_Play with the above example full of fun monkey pictures by opening example/example.html after downloading the repo._ @@ -81,4 +81,5 @@ _Play with the above example full of fun monkey pictures by opening example/exam 1. What's the license? [MIT](http://en.wikipedia.org/wiki/MIT_License). 2. Does it support horizontal menus or submenus that open to the left? Yup. Check out the submenuDirection option above. -3. I'm not nearly bored enough. Got anything else? [Read about this plugin's creation](http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown). +3. I work at a big company that requires a version number on this third party code before I can use it. Do you have a version number? Sure, current version: 1.1 +4. I'm not nearly bored enough. Got anything else? [Read about this plugin's creation](http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown). diff --git a/example/example.html b/example/example.html index d2f934b..c81ede4 100644 --- a/example/example.html +++ b/example/example.html @@ -32,7 +32,7 @@ You can choose to do whatever you want w/ those events. --> - .popover { + .navbar .popover { width: 400px; -webkit-border-top-left-radius: 0px; -webkit-border-bottom-left-radius: 0px; @@ -41,23 +41,34 @@ overflow: hidden; } - .popover-content { + .navbar .popover-content { text-align: center; } - .popover-content img { + .navbar .popover-content img { height: 212px; max-width: 250px; } - .dropdown-menu > li > a:hover { + .navbar .dropdown-menu { + -webkit-border-top-right-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; + + -webkit-box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2); + } + + .navbar .dropdown-menu > li > a:hover { background-image: none; color: white; background-color: rgb(0, 129, 194); background-color: rgba(0, 129, 194, 0.5); } - .dropdown-menu > li > a.maintainHover { + .navbar .dropdown-menu > li > a.maintainHover { color: white; background-color: #0081C2; } @@ -83,7 +94,6 @@ @@ -117,56 +192,9 @@

jQuery-menu-aim example

- - - - - - - - - - - - - - - + + + diff --git a/jquery.menu-aim.js b/jquery.menu-aim.js index b06f888..0c32941 100644 --- a/jquery.menu-aim.js +++ b/jquery.menu-aim.js @@ -147,6 +147,13 @@ options.exit(this); }; + /* + * Immediately activate a row if the user clicks on it. + */ + var clickRow = function() { + activate(this); + }; + /** * Activate a menu row. */ @@ -306,7 +313,9 @@ .mouseleave(mouseleaveMenu) .find(options.rowSelector) .mouseenter(mouseenterRow) - .mouseleave(mouseleaveRow); + .mouseleave(mouseleaveRow) + .click(clickRow); + $(document).mousemove(mousemoveDocument); };