JSFiddle - React, Tailwind, and code Playground
by Anam Ansari
HTML
<body style="background-image:url('img2/Mesh2.png');background-repeat:no-repeat; background-size: cover; width=:'100%'">
<h1>Sample For Image Slider</h1>
<div id="header">
</div>
<div id="container">
<div id="center" class="column">
<!-- This is all the XHTML ImageFlow needs -->
<div id="myImageFlow" class="imageflow">
<img src="img/img1.png" longdesc="img/img1.png" width="300" height="360" alt="1" />
<img src="img/img2.png" longdesc="img/img2.png" width="300" height="360" alt="2" />
<img src="img/img3.png" longdesc="img/img3.png" width="300" height="360" alt="3" />
<img src="img/img4.png" longdesc="img/img4.png" width="300" height="360" alt="4" />
<img src="img/img1.png" longdesc="img/img1.png" width="300" height="360" alt="5" />
<img src="img/img2.png" longdesc="img/img2.png" width="300" height="360" alt="6" />
<img src="img/img3.png" longdesc="img/img3.png" width="300" height="360" alt="7" />
<img src="img/img4.png" longdesc="img/img4.png" width="300" height="360" alt="8" />
<img src="img/img1.png" longdesc="img/img1.png" width="300" height="360" alt="9" />
<img src="img/img2.png" longdesc="img/img2.png" width="300" height="360" alt="10" />
</div>
</div>
<div id="left" class="column">
</div>
<div id="right" class="column">
</div>
</div>
<div id="footer">
</div>
</body>
CSS
/* @charset "utf-8";
@media screen, projection {
.imageflow {
overflow: hidden;
position: relative;
text-align: left;
visibility: hidden;
width: 100%
}
.imageflow img {
border: none;
position: absolute;
top: 0px;
visibility: hidden;
-ms-interpolation-mode: bicubic
}
.imageflow p {
margin: 0 auto;
text-align: center
}
.imageflow .loading {
border: 1px solid white;
height: 15px;
left: 50%;
margin-left: -106px;
padding: 5px;
position: relative;
visibility: visible;
width: 200px
}
.imageflow .loading_bar {
background: #fff;
height: 15px;
visibility: visible;
width: 1%
}
.imageflow .navigation {
z-index: 10000
}
.imageflow .caption {
font-weight: bold;
position: relative;
text-align: center;
z-index: 10001
}
.imageflow .scrollbar {
border-bottom: 1px solid #b3b3b3;
position: relative;
visibility: hidden;
z-index: 10002;
height: 1px
}
.imageflow .slider {
background: url(slider.png) no-repeat;
height: 14px;
margin: -6px 0 0 -7px;
position: absolute;
width: 14px;
z-index: 10003
}
.imageflow .slideshow {
cursor: pointer;
height: 14px;
margin: 20px 0 0 20px;
position: absolute;
width: 14px;
z-index: 10003
}
.imageflow .slideshow.pause {
background: url(button_pause.png) no-repeat
}
.imageflow .slideshow.play {
background: url(button_play.png) no-repeat
}
.imageflow .images {
overflow: hidden;
white-space: nowrap
}
.imageflow .button {
cursor: pointer;
height: 17px;
position: relative;
width: 17px
}
.imageflow .previous {
background: url(button_left.png) top left no-repeat;
float: left;
margin: -7px 0 0 -30px
}
.imageflow .next {
background: url(button_right.png) top left no-repeat;
float: right;
margin: -7px -30px 0 30px
}
*/
.t1
{
transform: skewX(5deg) skewY(175deg); /* W3C */
-webkit-transform: skewX(5deg) skewY(175deg); /* Safari & Chrome */
-moz-transform: skewX(5deg) skewY(160deg); /* Firefox */
...
JavaScript
$(document).ready(function () {
//select first image and tilt all others
$("#myImageFlow img:first").nextAll().removeClass('t1').addClass('t2');
//image click function
$("img").click(function(){
console.log('i am Image Flip');
var t = $(this);
this.className = '';
t.prevAll().removeClass('t2').addClass('t1');
t.nextAll().removeClass('t1').addClass('t2');
});
//hover function
$("img").hover(function(){
$(this).toggleClass('t1, t2');
});
});