earthquake!
< Feedback on earthquake
Hi fellow developer! You forgot to call a function on line 15!
There is fixed code:
(function() { 'use strict'; const elements = document.querySelectorAll('body *') elements.forEach(elem => { elem.addEventListener('mouseenter', () => { elem.style.position = 'relative'; elem.style.top = Math.random() * 100 + 'px'; }) }) })();
I also modified it a bit to make it work only with <body>'s children, and changed positioning from absolute to relative, so elements won't stack.
<body>
absolute
relative
Sign in to post a reply.
Hi fellow developer! You forgot to call a function on line 15!
There is fixed code:
I also modified it a bit to make it work only with
<body>
's children, and changed positioning fromabsolute
torelative
, so elements won't stack.