html5 - Element retains on-hover property of parent, when hover over itself and not parent -


.filename-display {      padding: 0 2px 0 7px  }    .filename-display:hover~.thumb-list-view {      display: block;  }    .thumb-list-view {      display: none;      position: absolute;      z-index: 2;      top: -90px;      height: 90px;      width: 120px;      pointer-events: none;  }    .thumb-list-view img {      height: 90px!important;      width: 120px!important;  }
<div class="text-ellipsis filename-display">material name</div>  <div class="thumb-list-view thumb-list-view-22" style="margin-top: 125px;">  	<img class="thumb-img" ng-src="https://thumb1.shutterstock.com/display_pic_with_logo/2764438/389965999/stock-vector-vector-laptop-personal-computer-in-flat-style-desktop-computer-computer-icon-isolated-on-389965999.jpg" src="https://thumb1.shutterstock.com/display_pic_with_logo/2764438/389965999/stock-vector-vector-laptop-personal-computer-in-flat-style-desktop-computer-computer-icon-isolated-on-389965999.jpg">  </div>

with code show thumb image below filename-display div when user hovers on name. , remove mouse name image hidden. issue arises when hover on name , scroll down, takes split second hide image. wondering if split second lag in dom updation or lag can eliminated?

it looks there chaining issue while trying display image on hover. there no class .material-name still used apply hover event. try removing it. works expected

.material-list .filename-display {      padding: 0 2px 0 7px  }    .filename-display:hover~.thumb-list-view {      display: block;  }    .thumb-list-view {      display: none;      position: absolute;      z-index: 2;      top: -90px;      height: 90px;      width: 120px;      pointer-events: none;  }    .thumb-list-view img {      height: 90px!important;      width: 120px!important;  }
<div class="text-ellipsis filename-display">material name</div>  <div class="thumb-list-view thumb-list-view-22" style="margin-top: 125px;">  	<img class="thumb-img" ng-if="material.material_type === msvm.materialconfig.materialtype.fabric" ng-src="http://10.127.22.171:8080/designportal/mos/app/60031755_front_tile.jpg" dp-image-fallback-src="img/mos/apparel/fabric/type-na/woven.jpg" src="img/mos/apparel/fabric/type-na/woven.jpg">  </div>


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -