Select background image with jQuery
I have the following CSS adding a background image to a series of list items each of which carry a unique id.
- .revolve
- {
- background: url(images/page_edit.png) 0 9px no-repeat #fff;
- }
I am trying to add a class to the background image using jQuery.
- $("background-image","url(images/page_edit.png)").addClass("edit_tasks")
So I can link to a page (passing id parameter) using click event
- $(".edit_tasks").click(function(){
- categoryId = $(this).parent("li").attr("id");
- window.location = 'tasksdisplayed.php?category_id='+categoryId
- });
But the approach used above to select the background image isn't working.
Any help would be appreciated.
Thanks,
Jim