jordanhudgens / portfolio-html-site

253 stars 445 forks source link

img-darken #8

Closed ArcxSx closed 3 years ago

ArcxSx commented 3 years ago

I just made this website from the udemy tutorial, but when I'm hovering over the portfolio-item-wrapper its making the whole wrapper dark along with the logo and subtitle. How do I fix that?

AllenDcoder commented 3 years ago

Hello there, i think this is how you should write the javascript code:

const portfolioItems = document.querySelectorAll('.portfolio-item-wrapper');

portfolioItems.forEach(portfolioItem => { portfolioItem.addEventListener('mouseover', () => { console.log(portfolioItem.childNodes[1].classList) portfolioItem.childNodes[1].classList.add('image-blur'); });

portfolioItem.addEventListener('mouseout', () => { console.log(portfolioItem.childNodes[1].classList) portfolioItem.childNodes[1].classList.remove('image-blur'); }); });

If this works let me know.

yam-turtle commented 3 years ago

Hi, I had the same problem and fixed it by closing the <div class="portfolio-img-background" style="background-image:url(images/1.jpg)"></div> (previously closed it under the text-wrapper) hope this helps!

ArcxSx commented 3 years ago

Hi, I had the same problem and fixed it by closing the <div class="portfolio-img-background" style="background-image:url(images/1.jpg)"></div> (previously closed it under the text-wrapper) hope this helps!

yes this worked out. Thanks :)