@psdesignro
Posted
Hi Fatima,
Your solution looks good. Regarding the layout, I suggest you shoud add more padding for the thext some line-height for p and also a bit more width for the image.
I can't give you an extended feedbak regarding JS because it's also new for me, but you can check my solution, because I see that you have wrote a lot of code, and I achieved the desired functionality with 4 lines of JS.
const shareIcon = document.getElementById("share-icon"); const shareBox = document.getElementById("share-box"); shareIcon.addEventListener('click', function(){ shareBox.classList.toggle('show'); });
I used classList toggle method to add/ remove the class for the share tooltip.
Check here https://psdesignro.github.io/article-preview/ how it works!
Marked as helpful