Skip to content

Instantly share code, notes, and snippets.

@ramzs
Created July 14, 2022 21:12
Show Gist options
  • Save ramzs/667596c211ddd74280fce6a6132d5f05 to your computer and use it in GitHub Desktop.
Save ramzs/667596c211ddd74280fce6a6132d5f05 to your computer and use it in GitHub Desktop.
Circle resize js
// 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