Simulating :active with jQuery
For hover, I do this:
$('.btn').hover(function (event) {
$(this).toggleClass('hover');
});
Is there any similar w开发者_StackOverflow社区orkaround for :active? Need it for the damned IE6.
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');
});
Theres some info on here:
http://csscreator.com/node/31976
精彩评论