• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Need help about add css to 2 div when hover

#1
I want add css to 2 div when i hover, demo when normal ( no hover)



and when i hover to add "Aj" to css on 2 div


Thanks you so much, i use xenforo 1.1.2 :)
 

Chris D

XenForo developer
Staff member
#2
For what purpose, exactly?

With CSS you can just use the :hover selector...

Something like:

Code:
.F9a div:hover
{
 color: red;
}
That would basically turn any text in a div element within the .F9a parent class red.

So that should enable you to do whatever hover based effects you need.

If you DO actually need a class appending automatically on hover (again, why?) then that would require some custom jQuery/JavaScript and is therefore probably beyond the scope of this forum unless you find a developer who is familiar with jQuery and javascript.
 
#3
For what purpose, exactly?

With CSS you can just use the :hover selector...

Something like:

Code:
.F9a div:hover
{
color: red;
}
That would basically turn any text in a div element within the .F9a parent class red.

So that should enable you to do whatever hover based effects you need.

If you DO actually need a class appending automatically on hover (again, why?) then that would require some custom jQuery/JavaScript and is therefore probably beyond the scope of this forum unless you find a developer who is familiar with jQuery and javascript.
i want when i hover to class yAw then on 2 div below will add class "Aj" , i want make a navigation like gg+
you can see demo at that :)
 

MagnusB

Well-known member
#5
Use addClass and removeClass with jquery. I still don't understand why you need to change class if you are using a hover event anyway you can just use :hover.