"Anirudha Bhowmik door effect"
Bootstrap 4.1.1 Snippet by anirudhabhowmik

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<script src="https://s.codepen.io/assets/libs/prefixfree.min.js"></script>
<script src="https://code.jquery.com/jquery-latest.js"></script>
<p class="alert"> </p>
<div class=".perspective" onclick="openDoor(this)">
<div class=".thumb">
</div>
</div>
<div class=".perspective" onclick="openDoor(this)">
<div class=".thumb">
</div>
</div>
<div class=."perspective" onclick="openDoor(this)">
<div class=".thumb">
</div>
</div>
<div class=".perspective" onclick="openDoor(this)">
<div class=".thumb">
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
body
{
background-color:#f0f0f0;
}
.container
{
margin:0 auto;
width:90%;
}
.perspective
{
background: url("http://dc428.4shared.com/img/QWu4ziBq/s3/doorBorder.png");
background-repeat: no-repeat;
background-position: center center;
position: relative;
display: inline;
float: left;
height: 274px;
width: 147px;
margin: 20px;
margin-left: 0px;
-webkit-perspective: 450;
border-radius: 3px;
box-sizing: border-box;
}
.thumb
{
background: url("http://dc428.4shared.com/img/-vayshJ-/s3/ClassDoor.png");
background-repeat: no-repeat;
background-position: center center;
width: 147px;
height: 274px;
position: absolute;
box-sizing: border-box;
border-radius: 3px;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
function openDoor(field) {
var y = $(field).find(".thumb");
var x = y.attr("class");
if (y.hasClass("thumbOpened")) {
y.removeClass("thumbOpened");
}
else {
$(".thumb").removeClass("thumbOpened");
y.addClass("thumbOpened");
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: