0
我有一個按鈕,其中:hover
和:focus
css屬性。在盤旋時,顏色變爲紅色。 現在,當我點擊它時,出現一個Alertify確認框,然後我按ok或取消顏色更改爲紅色,因爲:focus
屬性。 如何取消綁定:focus
點擊確定或取消。如何在關閉「altertify」確認模式後從按鈕上移除焦點?
<html>
<head>
<script src="https://cdn.jsdelivr.net/alertifyjs/1.8.0/alertify.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/alertifyjs/1.8.0/css/alertify.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/alertifyjs/1.8.0/css/themes/default.min.css"/>
</head>
<style>
.btn-test:hover,.btn-test:focus{
background-color:red;
}
</style>
<body>
<button class="btn-test">Click Me</button>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(".btn-test").click(function(){
alertify.confirm('Confirmation', 'You clicked', function() {
//do nothing
}
, function() {
//do nothing
});
});
</script>
</html>