Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
模拟:使用jQuery激活_Jquery_Internet Explorer - Fatal编程技术网

模拟:使用jQuery激活

模拟:使用jQuery激活,jquery,internet-explorer,Jquery,Internet Explorer,对于悬停,我执行以下操作: $('.btn').hover(function (event) { $(this).toggleClass('hover'); }); 对于:active是否有类似的解决方法?该死的IE6需要它。这里有一些信息: 这里有一些信息: 您可以使用jQuery mousedown()来模拟这种情况 请看下面的示例: 您可以使用jQuery mousedown()来模拟这一点 请看下面的示例: $('.btn').mousedown(function(){

对于悬停,我执行以下操作:

$('.btn').hover(function (event) {
   $(this).toggleClass('hover');
});

对于:active是否有类似的解决方法?该死的IE6需要它。

这里有一些信息:


这里有一些信息:


您可以使用jQuery mousedown()来模拟这种情况

请看下面的示例:


您可以使用jQuery mousedown()来模拟这一点

请看下面的示例:

$('.btn').mousedown(function(){
    $(this).addClass('active');
}).mouseup(function(){
    $(this).removeClass('active');
});