Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

JQuery Hover function syntax

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am new to JQuery and need a requirement of hover using css. I have the snippet which does the job but inorder to avoid code duplication i came up with a snippet for which facing issue with the syntax.

My Snippet with syntax issue:



Actual Snippet:


Just add 1,2,3 to .bu is the only requirement. i tried with for loop but facing issue with syntax.

Please help me

Thanks
tarik


 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you give them all separate classes? Give them all the same class and use this inside the object to work with the link.



Eric
 
Tarik Ansari
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

The reason why i needed bu1,bu2,bu3 is if i use common bu1 for the ahref, all are highlighted as a part of hover function. So thought i can have bu1,bu2 etc



But using of 'this' eliminates the necessity of individual bu1,bu2,bu3 etc



Hence, code works.

Thanks for the help

Tarik


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic