google chrome - CSS filter breakes overflow:hidden in Webkit -
so i've come across weird css-issue in webkit-based browsers (chrome, opera, ...). when apply overflow:hidden
on parent div , filter:grayscale(100%)
(or other kind of filter), overflow breaks. elements not hidden anymore reason.
i've tested on chrome, firefox, edge , opera. edge , firefox don't seem have issue, chrome , opera have it. guess may issue webkit-based browsers.
i've made small video better illustrate issue (images in video may differ ones in post, effect same. cursor appears on wrong places, it's clicking on arrows , hovering/clicking on icons. sharex not high-dpi displays, apparently.)
does have idea how can work around this?
html
<div id="projects"> <img id="left" src="https://i.imgur.com/8u7kir7.png"> <div id="scroller"> <figure><a id="portfolio1"><img src="https://i.imgur.com/ou2vsum.png" alt="breakingbook"></a></figure> <figure><a id="portfolio2"><img src="https://i.imgur.com/ou2vsum.png" alt="breakingbook"></a></figure> <figure><a id="portfolio3"><img src="https://i.imgur.com/ou2vsum.png" alt="breakingbook"></a></figure> <figure><a id="portfolio4"><img src="https://i.imgur.com/kml3kay.png" alt="redalert"></a></figure> <figure><a id="portfolio5"><img src="https://i.imgur.com/kml3kay.png" alt="redalert"></a></figure> <figure><a id="portfolio6"><img src="https://i.imgur.com/kml3kay.png" alt="redalert"></a></figure> </div> <img id="right" src="https://i.imgur.com/rnnphet.png"> </div>
scss
#projects { text-align: center; display: flex; justify-content: center; align-items: center; img { min-width: initial; max-width: initial; width: 70px; height: 70px; } #scroller { width: 330px; overflow: hidden; display: flex; justify-content: flex-start; align-items: center; border: 5px solid black; border-radius: 25px; padding-left: 20px; padding-right: 20px; figure { &:first-of-type { margin-left: 20px; } &:last-of-type { padding-right: 40px; } width: 70px; height: 70px; margin-right: 40px; display: block; { filter: grayscale(100%); line-height: initial; opacity: .3; &:hover { opacity: 1; } } } } }
jquery
$('#projects').find('a').click(function() { $('#projects').find('a').not(this).removeattr('style'); $(this).css('opacity', '1').css('filter', 'initial'); }); $('#left').click(function() { $('#scroller').animate({ scrollleft: $('#scroller').scrollleft() - 330 }, 500); }); $('#right').click(function() { $('#scroller').animate({ scrollleft: 330 + $('#scroller').scrollleft() }, 500); });
Comments
Post a Comment