0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CSS/javascriptで文字列・背景色を反転で点滅する

Last updated at Posted at 2021-03-12

CSS3の方法と点滅する方法はあったが、反転で点滅する方法が無かったので作成。

<html>
<head>
<style>
p {
	font-size: 8ex;
	font-weight: bold;
}
</style>
<script>
	function blink() {
		obj = document.getElementsByTagName("body");
		obj2 = document.getElementsByTagName("p");

		obj[0].style.backgroundColor = "#FF0000";
		obj2[0].style.color = "#FFFF00";
		obj2[1].style.color = "#FFFF00";

		setTimeout("blink2()", 1000);
	}
	function blink2() {
		obj = document.getElementsByTagName("body");
		obj2 = document.getElementsByTagName("p");
		
		obj[0].style.backgroundColor = "#FFFF00";
		obj2[0].style.color = "#FF0000";
		obj2[1].style.color = "#FF0000";
		
		setTimeout("blink()", 1000);
	}
</script>
</head>
<body onload="blink()">
<p>予定より作業が押しています。</p>
<p>今しばらくお待ちください。</p>
</body>
<html>

ネタ元
CSS/javascriptで文字列・背景色を点滅する | いなかんSE
https://ameblo.jp/sirokuma-takano/entry-11540390191.html

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?