To receive quicker and more accurate responses, please share the relevant code for your issue instead of requiring others to search through your website.
Here's a straightforward alternative solution:
HTML
<div id="navigation">
<a id="foo" href="#"> </a>
<a id="bar" href="#"> </a>
<a id="baz" href="#"> </a>
</div>
CSS
a#foo {
background: url('foo-inactive.png') no-repeat;
}
a#foo:hover,
a#foo.active {
background: url('foo-active.png') no-repeat;
}
This implementation creates a hover effect. Apply the same method to other IDs. Include padding to ensure the link is wide enough to display the background image. Alternatively, use display="block"
with width/height attributes.
If clicking the image redirects you, add class="active"
in the HTML (<a id="foo" class="active"...
). If staying on the current page, try this:
jQuery
$(document).ready(function() {
// select each link inside the navigation div
$('#navigation a').click(function() {
// clicked link
clicked = $(this).attr('id');
// make sure only the clicked link is active
$('#navigation a').each(function() {
if ($(this).attr('id') == clicked) {
$(this).addClass('active');
} else {
$(this).removeClass('active');
}
});
// prevent default link behavior
return false;
});
});