I have a menu bar with blocks inside a div. I am looking to create a jQuery script that changes the class of surrounding blocks in the menu when hovering over a specific one. My idea is to use a switch statement that checks the ID of $(this) and then modifies the surrounding classes accordingly. Additionally, I want the class to revert back once I stop hovering over it.
Here is a fiddle to illustrate:
// JavaScript code here...
@import url('styles.css');
<!-- HTML code here... -->
The goal is for #1 and #2 to highlight when hovering over #iz, #2 and #3 to highlight when hovering over #zn, and so forth. The classes should return to their original state when not being hovered over.
Thank you for your assistance!