I've created a div with a number displayed initially. When I hover over the div, the number disappears and a paragraph is revealed. Upon hovering out, the paragraph hides and the number reappears.
My attempts to achieve this using CSS (display: none and display: block) and jQuery (show() and hide()) have had mixed results. Sometimes, both the number and paragraph vanish, requiring me to refresh the page to restore them. The functionality seems more reliable in Chrome compared to other browsers, but it still isn't perfect even there.
You can test this on the live page here.
The code snippet for this feature looks like:
div h2 {
display: block;
}
div:hover h2 {
display: none;
}
div p {
display: none;
}
div:hover p {
display: block;
}
If anyone has suggestions on how to improve this behavior, please let me know!