i have a part of css code, how can i add this css with jquery ?
div#menu li:hover>div {
visibility: visible;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Although Sarfraz and Anthony’s answers would work there are a couple of points to note.
1) To hide/show you are better just using the
hide()andshow()mothods available on a jQuery object.So,
2) Try to use css classes instead, rather than direct use of the
.css()function3) With your selector,
div#menuis pointless. An id selector is faster. All you do when you put the element selectordivin front of it is slow it down:Also, start accepting answers and voting. It good courtesy – It earns people points, which they like, and makes them more inclined to help you in future.