Home > Web Front-end > HTML Tutorial > How to use button trigger to achieve background color flashing

How to use button trigger to achieve background color flashing

php中世界最好的语言
Release: 2018-02-08 09:51:13
Original
3430 people have browsed it

This time I will show you how to use the button to trigger the flashing of the background color. What are the precautions for using the button to trigger the flashing of the background color. The following is a practical case. Let’s take a look.

To achieve the background color flashing effect, just add the following code to the area

  <script language="Javascript"> 
  function blinkit() 
  { 
   intrvl=0; 
   for(nTimes=0;nTimes<3;nTimes++) 
   { 
   intrvl += 200; 
   setTimeout("document.bgColor=&#39;#0000FF&#39;;",intrvl); 
   intrvl += 200; 
   setTimeout("document.bgColor=&#39;#336699&#39;;",intrvl); 
   } 
  } 
  </script> 
  <input type="button" value="Blink" onClick="blinkit()">
Copy after login

I believe you have mastered the method after reading these cases, please come for more exciting Pay attention to other related articles on php Chinese website!

Related reading:

How to upload files asynchronously in html

The margin-top element in the div tag is invalid Solution

#iframe node initialization

The above is the detailed content of How to use button trigger to achieve background color flashing. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template