JSFiddle - React, Tailwind, and code Playground
by jchaplin2
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
<div class="slogan">
<img class="onelogo" src="http://via.placeholder.com/350x150">
</div>
<script>
var waypoint;
function handleWayPoint() {
var $width = $(window).width();
console.log($width);
if($width > 950) {
waypoint[0].enable();
}
else {
waypoint[0].disable();
}
}
$(document).ready(function(){
"use strict";
waypoint= $('.slogan').waypoint(function(direction) {
$('.onelogo').toggleClass('hide', direction === 'down');
});
handleWayPoint();
$(window).resize(function() {
handleWayPoint();
});
});
</script>
CSS
body{
height:1100px;
}
.slogan {
display: block;
position: absolute;
right: 10%;
top: 40%;
line-height: 34px;
color: #949494;
z-index: 10;
}
.onelogo {
display: block;
height: 110px;
width: auto;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.hide {
opacity: 0;
margin-top: -29vh;
}