درود ...
HTML , CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div>
<button id="primary">Primary</button>
<button id="danger">Danger</button>
<button id="success">Success</button>
</div>
<script src="script.js"></script>
</body>
</html>
//
div {
display: flex;
justify-content: center;
}
button {
padding: 10px 20px;
margin: 5px;
background-color: black;
color: #fff;
border: none;
outline: none;
border-radius: 5px;
}
JavaScript
let btnPrimary = document.querySelector('#primary');
let btnDanger = document.querySelector('#danger');
let btnSuccess = document.querySelector('#success');
btnPrimary.addEventListener('click', () => btnPrimary.style.backgroundColor = '#337ab7')
btnDanger.addEventListener('click', () => btnDanger.style.backgroundColor = '#c9302c')
btnSuccess.addEventListener('click', () => btnSuccess.style.backgroundColor = '#4cae4c')```
HTML
<center>
<div id="myLine"></div>
<br />
<button id="myButton">
Draw Line
</button>
</center>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
CSS
#myLine {
height: 1px;
width: 0px;
background: black;
margin-top: 25px;
}
.animate {
-webkit-animation: myfirst 5s;
animation: myfirst 5s;
}
@keyframes myfirst {
0% {width: 0px;}
100% {width: 500px;}
}
@-webkit-keyframes myfirst {
0% {width: 0px;}
100% {width: 500px;}
}
#myButton {
display: block;
border: 0px;
border-radius: 5px;
width: 200px;
height: 50px;
background: #000;
color: #FFF;
}
JS
$(function(){
$('#myButton').click(function(){
e1 = $('#myLine');
e1.addClass('animate');
e1.one('webkitAnimationEnd oanimationend msAnimationEnd animationend',
function (e) {
e1.removeClass('animate');
});
});
});
آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟