JavaScriptを使ってページ内の指定タグをsetTimeoutでループして数pxランダムに動し続ける方法をご紹介します。 指定タグをsetTimeoutでループして動かし続けるCSSの記述 ※以下は任意です。必要に応じて変更して下さい。 <style type="text/css"> <!-- body { margin: 0px; font-size:14px; } h1{ font-size:16px; font-weight:normal; line-height:1em; text-align:center; padding:15px 0 0 0; } #idWrap{ width:600px; margin:0 auto; text-align:center; } ul{ width:200px; margin:0 auto; } li{ line-height:1.4em
![指定タグをsetTimeoutでループして動かし続けるJavaScript|DAD UNION – エンジニア同盟](https://cdn-ak-scissors.b.st-hatena.com/image/square/bd66d58d0afa2fb2bfd0f34ee058e0cafda49e4f/height=288;version=1;width=512/https%3A%2F%2Fdad-union.com%2Fwp-content%2Fuploads%2F2019%2F07%2Fcap20190723.jpg)