Skip to content Skip to sidebar Skip to footer

Jquery Div Hover Change Other Div Class

I'm trying to make one div change its class when hovering over its container div. See below the the code.. Structure goes like this: Div Container Top Div Middle Div Bo

Solution 1:

I threw together a jsfiddle for you here.

as @charliegriefer said - make sure you have jQuery included and the css for .fboto is defined.

I may have misunderstood what you were asking, so I updated my jsfiddle. I think @Felix Kling is right though - you were just missing the $(function(){...}); - which is basically a jquery onload method.

Solution 2:

Basically everything needs to go into the document ready function. Also if you use hover, you may need to use prepend. Notice that this is a fully working example.

$(document).ready(function () {

}

see below the html code:

<div id="container1" class="container1White">

Heading

Body

Footer

 
 

Post a Comment for "Jquery Div Hover Change Other Div Class"