For hover, I do this:
$('.btn').hover(function (event) {
$(this).toggleClass('hover');
});
Is there any similar workaround for :active? Need it for the damned IE6.
Thanks!
For hover, I do this:
$('.btn').hover(function (event) {
$(this).toggleClass('hover');
});
Is there any similar workaround for :active? Need it for the damned IE6.
Thanks!
You can use jQuery mousedown() to simulate this.
Look at the example here:
http://api.jquery.com/mousedown/#example-0
$('.btn').mousedown(function(){
$(this).addClass('active');
}).mouseup(function(){
$(this).removeClass('active');
});
You can do it the lazy way, just intercepting a mousedown
event.
$('.btn').mousedown(function (event) {
$(this).toggleClass('active');
});
or do it the cool way, write a special event
for it.