JSFiddle - React, Tailwind, and code Playground

by rodrigonery

HTML

<div id="main">
 <div class="text"><a href="#">Live background change using jQuery <span class="small">by</span> <span class="title">Webspeaks.in</span></a></div>
 <div>
  <ul class="menu">
    <li><img src="http://placeholder.it/200" /></li>
   <li><img src="http://placeholder.it/200" /></li>
   <li><img src="http://placeholder.it/200" /></li>
   <li><img src="http://placeholder.it/200" /></li>
   <li><img src="http://placeholder.it/200" /></li>
   <li><img src="http://placeholder.it/200" /></li>
  </ul>
 </div>
</div>

CSS

body {
    background-color: #CCCCCC;
}

#main {
    margin: 0;
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 100px;
}

ul.menu {
    list-style-type: none;
}

ul.menu li {
    display: inline;
}

img {
    height: 90px;
    width: 105px;
    border: 5px solid #333333;
    padding: 2px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
}

img:hover {
    border-color: #990099;
}

.text a {
    background-color: #33CCCC;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: bold;
    font-family: Georgia, "Times New Roman", Times, serif;
    height: 40px;
    line-height: 40px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 15px;
    border-radius: 15px;
    margin: 10px;
    padding: 10px;
    text-decoration: none;
}

.text .small {
    font-size: 16px;
}

.text .title {
    color: #993366;
}

JavaScript

$(function(){
 $('ul.menu').find('img').fadeTo('slow', 1);
 $('ul.menu').find('img').hover(function(){
  $(this).fadeTo('fast', 0.7);
  $('body').css({ 'background-image' : 'url('+$(this).attr('src')+')' });
 }, function(){
  $(this).fadeTo('slow', 1);
 });
});