fixtop | jQuery plugin to fix DOM element | Plugin library
kandi X-RAY | fixtop Summary
kandi X-RAY | fixtop Summary
jQuery plugin to fix DOM element to the top when a page scrolls to its position
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fixtop
fixtop Key Features
fixtop Examples and Code Snippets
Community Discussions
Trending Discussions on fixtop
QUESTION
I'm trying to make this dropdown menu happen in a fixed top bar.
I've look through lots of tutorials and forums, but nothing helped me.
I can't:
- Make the dropdown still when I get the cursor off from the "Trabalhos" button.
- Make the top bar elements still when the submenu shows - the button "Contato" get out of the bar as if it's floating.
Here is the code in CSSDesk (please hide the html/css sidebar so you can see the major problem: many on/off hover blinks when the cursor pass around the "Trabalhos" button).
I'm in the very beginning, so I'm sorry if my code is messy (if it really is, please tell me!)
...ANSWER
Answered 2017-Sep-21 at 17:50Since the submenu is a child of a main menu element, it expands the size of that main menu element when it appears. Consequently, the menu item moves away from the mouse cursor. When it does, the submenu closes and the main menu item moves back under the mouse cursor. This cycle causes a vibration between hover and non-hover states.
One solution is to set the submenu to be position:absolute
so that it's removed from the document flow. But this also means that the hover area for the main menu item will not include the area of the submenu, so the submenu will close when the mouse is moved away from the main menu item. To solve this, I've added another :hover
definition on the #submenu
element itself.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fixtop
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page