Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- // whenever we hover over a menu item that has a submenu
- $('li.parent').on('click', function() {
- var $menuItem = $(this),
- $submenuWrapper = $('> .wrapper', $menuItem);
- // grab the menu item's position relative to its positioned parent
- var menuItemPos = $menuItem.position();
- // place the submenu in the correct position relevant to the menu item
- $submenuWrapper.css({
- top: menuItemPos.top,
- left: menuItemPos.left + Math.round($menuItem.outerWidth() * 0.75)
- });
- });
- });
- .wrapper1 li:hover > .wrapper1 {
- display: block;
- }
- $(document).ready(function(){
- $(".wrapper ul li").click(function(){
- //do what ever you want to do with li
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement