-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
50 lines (50 loc) · 1.21 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<html>
<head>
<title>BorderColorAnimate</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="bordercoloranimate.min.js"></script>
<style>
body {
font: bold 12px arial, sans-serif;
}
.center {
text-align: center;
}
.mystyle {
display: inline-block;
width: 100px;
height: 100px;
margin: 100px 50px;
line-height: 100px;
border: 10px solid #66ff1a;
border-radius: 10px;
text-align: center;
cursor: pointer;
}
</style>
</head>
<body>
<div class="center">
<div id="test" class="mystyle">Click Here!</div>
<div id="test2" class="mystyle">Click Again!</div>
<div id="test3" class="mystyle">Mouse In/Out!</div>
</div>
<script>
(function ($) {
$(document).ready(function(){
$('#test').on('click', function(){
$(this).BorderColorAnimate('#ff1a4b');
});
$('#test2').on('click', function(){
$(this).BorderColorAnimate('#ff1a4b', 400, function(){$(this).BorderColorAnimate('#66ff1a');});
});
$('#test3').mouseenter(function () {
$(this).BorderColorAnimate('#ff1a4b');
}).mouseleave(function () {
$(this).BorderColorAnimate('#66ff1a');
});
});
})(jQuery);
</script>
</body>
</html>