I am having some trouble in trying to add an active state to my links. This the code I am playing with:
$(function () {
$('a').click(function () {
$(this).addClass('PnavCurrent');
//$("div a").removeClass("PnavCurrent");
//$("div a[href="+newHash+"]").addClass("PnavCurrent");
$(this).removeClass('PnavCurrent');
$(this).css('color', '#51ad9d');
$(this).css('z-index', '2');
$(this).css('border-color', '#00a8ff');
$('a').hover($(this).css('z-index', '10'));
});
});
For some reason it won't apply the css active state class ('PnavCurrent') for the links but it does work correctly when I specify it in the script code with {$(this).css...}
. Now what I would like is at add an hover state z-index for the links in the script code, something like this:
$('a').hover($(this).css ('z-index', '10'));
I've tried to use that little block of code above in trying to achieve this but it doesn't work. I would greatly appreciate it if anyone could help with this and possibly a better solution overall.