In need of a code that will enable text boxes on hover?

26 views Asked by At

Key word of my post is boxe***s***, emphasis on the plural. The code I am using will not allow me to reuse the hover on multiple pieces of text. Only one of the hovers will work at a time and the rest are frozen in place, as if they were text boxes with no hover (no hide and then reveal).

Please help me! I appreciate any input.

Here is the link to the code: http://pastebin.com/dRgj8e1D

1

There are 1 answers

2
David Millar On

Basically your code is only setting up toggling for the very first toggle, as shown in the window.onload section. To make multiple instances work, you would need to get the ID of each toggle button and call the toggle setup function for each one.

An easier way to accomplish this would be to change the ID on the button to a class and use hover styles in the CSS:

.togContent   {
    display: none;
}
.togTrigger:hover + .togContent {
    display: block;
}