JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<div id="first" class="inner-container">
<div id="wrapper">
<div id="slider-container">
<div id="nav">
<img id="prev" src="https://cdn4.iconfinder.com/data/icons/defaulticon/icons/png/256x256/arrow-right.png" />
<img id="next" src="https://cdn4.iconfinder.com/data/icons/defaulticon/icons/png/256x256/arrow-right.png" />
</div>
<div class="slider-view-area">
<div id="mask">
<div id="item11" class="item"> <a name="item11"></a>
<div class="content"> <a caption="A tableyv" rel="Sold" class="fancybox" data-fancybox-group="thumb1" href="http://fancyapps.com/fancybox/demo/4_b.jpg"><img id="image0" src="http://fancyapps.com/fancybox/demo/4_s.jpg" alt="" /></a>
<a caption="A table" rel="Sold" class="fancybox hidden" data-fancybox-group="thumb1" href="http://fancyapps.com/fancybox/demo/3_b.jpg"><img id="image1" src="http://fancyapps.com/fancybox/demo/3_s.jpg" alt="" /></a>
<img id="image2" src="http://placehold.it/350x150" />
<img id="image3" src="http://placehold.it/350x150" />
<img id="image4" src="http://placehold.it/350x150" />
<img id="image5" src="http://placehold.it/350x150" />
<img id="image6" src="http://placehold.it/350x150" />
<img id="image7" src="http://placehold.it/350x150" />
<img id="image8" src="http://placehold.it/350x150" />
<img id="image9" src="http://placehold.it/350x150" />
<img id="image10" src="http://placehold.it/350x150" />
</div>
</div>
<div id="item22" class="item">
...
CSS
#first {
width: 50%;
height: 220px;
margin:auto;
padding-left: 170px;
margin-top: 2px;
}
#first img {
height: 100px;
width: 100px;
float:left;
margin-right: 5%;
cursor: pointer;
}
#wrapper {
width: 10%;
padding: px 0;
}
#slider-container {
padding: 20px 50px;
height: 1350px;
top:-18%;
left: -45px;
width: 700px;
overflow: hidden;
position: relative;
}
.slider-view-area {
max-height: 300px;
}
#nav img {
position: absolute;
top: 40px;
left: 0px;
cursor:pointer;
color:grey;
}
#prev {
margin-left: 520px;
font-size: 30px;
}
#next {
right: -440px;
font-size: 30px;
}
#mask {
width: 5000px;
height: 100%;
}
.item {
width: 1200px;
height: 100%;
float: left;
}
.content img {
height: 100px;
width: 17%;
float:left;
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.content {
width: 50%;
height: 220px;
top: 30px;
left: margin: auto;
position: relative;
}
.content a {
position: relative;
top: -17px;
left: 170px;
}
.selected {
background: #fff;
font-weight: 700;
}
.clear {
clear:both;
}
.hidden {
display: none;
}
JavaScript
$(document).ready(function () {
var newItem = 0;
var itemCount = $('.item').length;
function shift(direction) {
var $mask = $('#mask'),
$items = $('.item'),
currentItem = $mask.data('currentItem');
if (currentItem === undefined) {
currentItem = 0;
}
$mask.data('currentItem', newItem).animate({
marginLeft: -newItem * $items.eq(0).width()
});
}
$('#prev').click(function () {
if (newItem === 0) {
newItem = itemCount - 1;
} else {
newItem--;
}
return shift();
});
$('#next').click(function () {
if (newItem === itemCount - 1) {
newItem = 0;
} else {
newItem++;
}
return shift();
});
function resizePanel() {
width = $(window).width();
height = $(window).height();
$('#wrapper').css({
width: width,
height: height
});
$('.item').css({
width: width - 100,
height: height
});
}
$(window).resize(function () {
resizePanel();
});
resizePanel();
});
jQuery(function ($) {
$('.slider-view-area img').hover(function () { // on mouseover
$('.slider-view-area img').stop().not(this).animate({
'opacity': 0.4
}, 700); // you can animate this as well
$(this).animate({
'opacity': 1
}, 700);
}, function () { // on mouseout
$('#.slider-view-area img').animate({
'opacity': 1
}, 700);
});
});