JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<section class="image-menu">
<div>
<ul id="image-menu-container" class="btn-group">
<li class="btn">
<div id="slider" style="width:444px;height:106px;"> <a href="javascript:;" class="control_next" style="color:#aaa;">></a>
<a href="javascript:;" class="control_prev" style="color:#aaa;"><</a>
<ul>
<li class="red">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Color_icon_red.svg/300px-Color_icon_red.svg.png" alt="" width="444" height="106" border="0"/>
</li>
<li class="test">
<img src="http://ofbuckleyandbeatles.files.wordpress.com/2011/01/testpattern.gif?w=320" alt="" width="444" height="106" border="0"/>
</li>
<li class="blue">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Color_icon_blue.svg/220px-Color_icon_blue.svg.png" alt="" width="444" height="106" border="0"/>
</li>
</ul>
</div>
<div><strong>Lorem Ipsum</strong>
</div>
</li>
<li class="btn">
<div id="profes" style="width:444px;height:106px;"> <a href="javascript:;" class="ctrl_next" style="color:#aaa;">></a>
<a href="javascript:;" class="ctrl_prev" style="color:#aaa;"><</a>
<ul>
<li class="test">
<img src="http://ofbuckleyandbeatles.files.wordpress.com/2011/01/testpattern.gif?w=320" alt="" width="444" height="106" border="0"/>
</li>
<li class="blue">
...
CSS
.image-menu {
width:1160px;
text-align:center;
margin:0 auto;
position:relative;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 10px;
}
#slider {
position: relative;
overflow: hidden;
margin: 3px auto 0 auto;
border-radius: 4px;
}
#slider ul {
position: relative;
margin: 0;
padding: 0;
height: 200px;
list-style: none;
}
#slider ul li {
position: relative;
display: block;
float: left;
margin: 0;
padding: 0;
width: 444px;
height: 106px;
background: #ccc;
text-align: center;
line-height: 106px;
}
#profes {
position: relative;
overflow: hidden;
margin: 3px auto 0 auto;
border-radius: 4px;
}
#profes ul {
position: relative;
margin: 0;
padding: 0;
height: 200px;
list-style: none;
}
#profes ul li {
position: relative;
display: block;
float: left;
margin: 0;
padding: 0;
width: 444px;
height: 106px;
background: #ccc;
text-align: center;
line-height: 106px;
}
a.control_prev, a.control_next {
position: absolute;
top: 0%;
z-index: 999;
display: block;
padding: 9% 2%;
width: auto;
height: auto;
background: #2a2a2a;
color: #fff;
text-decoration: none;
font-weight: 600;
font-size: 18px;
opacity: 0.8;
cursor: pointer;
}
a.control_prev:hover, a.control_next:hover {
opacity: 1;
-webkit-transition: all 0.2s ease;
}
a.control_prev {
border-radius: 0 2px 2px 0;
}
a.control_next {
right: 0;
border-radius: 2px 0 0 2px;
}
a.ctrl_prev, a.ctrl_next {
position: absolute;
top: 0%;
z-index: 999;
display: block;
padding: 9% 2%;
width: auto;
height: auto;
background: #2a2a2a;
color: #fff;
text-decoration: none;
font-weight: 600;
font-size: 18px;
opacity: 0.8;
cursor: pointer;
}
a.ctrl_prev:hover, a.ctrl_next:hover {
opacity: 1;
-webkit-transition: all 0.2s...
JavaScript
jQuery(document).ready(function ($) {
var slideCount = $('#slider ul li').length;
var slideWidth = $('#slider ul li').width();
var slideHeight = $('#slider ul li').height();
var sliderUlWidth = slideCount * slideWidth;
$('#slider').css({
width: slideWidth,
height: slideHeight
});
$('#slider ul').css({
width: sliderUlWidth,
marginLeft: -slideWidth
});
$('#slider ul li:last-child').prependTo('#slider ul');
function moveLeft() {
$('#slider ul').animate({
left: +slideWidth
}, 200, function () {
$('#slider ul li:last-child').prependTo('#slider ul');
$('#slider ul').css('left', '');
});
};
function moveRight() {
$('#slider ul').animate({
left: -slideWidth
}, 200, function () {
$('#slider ul li:first-child').appendTo('#slider ul');
$('#slider ul').css('left', '');
});
};
$('a.control_prev').click(function () {
moveLeft();
});
$('a.control_next').click(function () {
moveRight();
});
var slideCount1 = $('#profes ul li').length;
var slideWidth1 = $('#profes ul li').width();
var slideHeight1 = $('#profes ul li').height();
var sliderUlWidth1 = slideCount1 * slideWidth1;
$('#profes').css({
width: slideWidth1,
height: slideHeight1
});
$('#profes ul').css({
width: sliderUlWidth1,
marginLeft: -slideWidth1
});
$('#profes ul li:last-child').prependTo('#profes ul');
function moveLeft1() {
$('#profes ul').animate({
left: +slideWidth1
}, 200, function () {
$('#profes ul li:last-child').prependTo('#profes ul');
$('#profes ul').css('left', '');
});
};
function moveRight1() {
if (slideCount1==2) {
$('#profes ul').css('width', sliderUlWidth1+slideWidth1);
$('#profes ul...