JSFiddle - React, Tailwind, and code Playground

by jackrugile

HTML

<div class="holder"><div class="highlight"></div></div>

CSS

body {
 background: #000   
}

.holder {
    background: #333;
      height: 50px;
    margin: 220px 0 0 220px;
    position: relative;
    overflow:hidden;
   width: 150px; 
}

.highlight {
    left: -170px;
    height: 100px;
    margin: -80px 0 0 0;
    position: absolute;
    width: 100%;
    -webkit-transform: rotate(45deg);
background: -moz-linear-gradient(left,  rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* IE10+ */
background: linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */

   
}

JavaScript

$(function(){
    $('.holder').mouseenter(function(){
        $this = $(this);
        $this.find('.highlight').stop(false, true).animate({'left' : '150px'}, 1000, function(){
            $this.find('.highlight').css('left', '-150px');
        });        
    }); 
});