<style>
.wrapper__image {
background: #fbfbfb;
margin: 50px;
display: inline-block;
width: 270px;
height: 420px;
overflow: hidden;
border-radius: 5px;
box-shadow: 10px 20px 70px -18px rgba(0, 36, 100, 0.12);
}
.wrapper__image img:not(.longwidth) {
width: 100%;
height:auto;
}
.wrapper__image img.longwidth {
height: 100%;
width: auto;
}
</style>
<script type="text/javascript">
function isLongWidth (that){
if(that.width>that.height)that.className = "longwidth";
}
</script>
<div class="wrapper__image"><img src="https://d13yacurqjgara.cloudfront.net/users/182238/screenshots/2604379/12-fire.jpg" onload="isLongWidth(this)"></div>
<div class="route">
<div class="intervalAll">
<div class="interval"></div>
<div class="interval" style="width:278px;border-color:green;background:#aaa"></div>
</div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
</div>
<div class="route">
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="arrow">></div>
<div class="bubble"></div>
<div class="intervalAll">
<div class="interval"></div>
<div class="interval" style="width:278px;border-color:green;background:#aaa"></div>
</div>
</div>
.intervalAll {
position:absolute;
}
$(document).ready(function(){ $("li").mouseenter(function(){ $( i,this).css({"background-image": "url(assets/blue-icon.png)"}); }).mouseleave(function(){ $( i,this).css({"background-image": "url(assets/white-icon.png)"}); }); });