with an inner not triggering :active state in IE 8

后端 未结 8 535
太阳男子
太阳男子 2020-12-03 15:48

I want to style the :active state of a button that is represented by an tag. The tag has an inner

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 16:41

    You can fix it using this:

    $('.yourspan').mousedown(function(){
        $(this).parents('.youranchor:first').css("background-position","bottom");   
    }); 
    $('.yourspan').mouseup(function(){
        $(this).parents('.youranchor:first').css("background-position","top");  
    });
    

提交回复
热议问题