html - How to stop jQuery from matching multiple elements -


I am trying to create a rollover effect with jquery. I have such things, but because I am trying to mouse over something with a link in which there is a link I problem.

I have a Level 2 nav bar, placeholder table cell (bad I know - but it has already been done this way). I want to turn background from white (#FFF) to dark brown (# 99). I also want to change the text from dark brown to white.

Since the text is a link, I have to specify a square within the link tag to ensure that it is dark brown without an underline, in the blue, undefined text the default T.

I have written that the code causes the change of all the links of the class = "all links" to being white, when any of them is "hovered over" I want to do this for special items - this background should be brown and the link should be white.

HTML and jQuery are below: -

  & lt; Td class = "submenuity" & gt; & Lt; A href = "newsletter.html" class = "sublink" & gt; Newsletter & lt; / A & gt; & Lt; / Td> & Lt; Td class = "subMenuTD" & gt; & Lt; A href = "news_archive.html" class = "sub link" & gt; News archive & lt; / A & gt; & Lt; / Td> & Lt; Td class = "submenuity" & gt; & Lt; A href = "events.html" & gt; Events & lt; / A & gt; & Lt; / Td> $ (". SubMenuTD") Hover (function () {$ (this) .addClass ("subMenuTDActive"); $ (". SubLink") .addClass ("subLink-white");}, function () {$ ( This) .removeClass ("subMenuTDActive"); $ (". SubLink"). RemoveClass ("subLink-white");}); Add a reference parameter to the    

$ () function.

$ (".subLink") -> $ (".subLink", this) will only match the ".subLink" jQuery given The children are the reference element


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -