I am having trouble with $this selector for JQuery. This is doing nothing. The fundamental core of the script is not failing though.
$(this).css("background-image",
"url(http://www.divethegap.com/update/z-images/diving-trips/tabs/bases-z.png)");
Any ideas why it does not work? I have tried the same effect using class.
THE FULL CODE (as requested)
http://jsfiddle.net/mcxez/1/:
Markup:
<a href="?accommodation" style="background-position:-15px top;"
onclick="inload('?accommodation'); return false">Accommodation</a>
<a href="?travel" style="background-position:-15px top;"
onclick="inload('?travel'); return false">Travel</a>
js:
function inload(thelink) {
$('.TABbase').click(function(){
$(this).css("background-image",
"url(http://www.divethegap.com/update/z-images/diving-trips/tabs/bases-z.png)");
});
return false;
}
Here is the revised HTML
Here is the javascript