-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
42 lines (41 loc) · 1.16 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
padding: 20%;
}
.item {
box-shadow: 0 20px 10px -3px rgba(0,0,0, 0.5);
transform: rotate(33deg);
display: inline-block;
border: 1px solid red;
padding: 0.5em;
}
.item--hover {
box-shadow: 0px 20px 60px -10px red;
}
</style>
</head>
<body>
<div class="item">This is rotated, but box shadow is always below</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="dist/rotatedBoxShadow.jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.item')
.rotatedBoxShadow()
.on('mouseenter', function() {
$(this).addClass('item--hover')
.rotatedBoxShadow('reloadCSS');
})
.on('mouseleave', function() {
$(this).removeClass('item--hover')
.rotatedBoxShadow('reloadCSS');
});;
});
</script>
</body>
</html>