I need help on this rollover - click events.. PLEASE!!!
Hi,
I am trying to use the following code to make a thumbnail change opacity when rollover, and become "light" when "click" on it. Everything works fine except that I need it to become opaque again when a second thumbnail is clicked. Right now if I click on one it became "light" but when I click on a second one both of the thumbnails are "light" and what I want is only the last click to be "light" and the previous one to become opaque if a second one is being clicked..... THANKS!!!
$(function()
{
var activeLink;
$('.scroll-pane a').css('opacity', .5).hover(
function()
{
$(this).
css('opacity', 1)
;
},
function()
{
if (this != activeLink) {
$(this).
css('opacity', .5)
;
}
}
).bind(
'click',
function()
{
activeLink = this;
}
);
}
);