jquery help with variables and click function
I'm creating a click function for a set of links that changes the background image of each of those links( different images for each link).
What I have is this:
- $(document).ready(function(){
- $('#nav a').click(function() {
- //$('#hlink').css({ backgroundImage : "url(images/home_animate.jpg)" });
-
- });
which all works fine, but what I want is
this:
-
- $('\'#' + $element + '\'').css({ backgroundImage : "url(images/home_animate.jpg)" });
where $element stores the id of the link clicked.
any help would be great.
Thanks