Created
July 14, 2022 21:12
-
-
Save ramzs/667596c211ddd74280fce6a6132d5f05 to your computer and use it in GitHub Desktop.
Circle resize js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Circle size | |
let circle = document.querySelectorAll('.article__age'); | |
circle.forEach(item => { | |
let circleWidth = item.offsetWidth; | |
item.style.height = circleWidth + 'px'; | |
}); | |
window.addEventListener('resize', function (event) { | |
circle.forEach(item => { | |
let circleWidth = item.offsetWidth; | |
item.style.height = circleWidth + 'px'; | |
}); | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment