Home  >  Article  >  Web Front-end  >  jquery simple implementation of interlaced color changing method

jquery simple implementation of interlaced color changing method

小云云
小云云Original
2017-12-23 10:12:332306browse

Front-end development is inseparable from jquery. jquery and JavaScript can achieve many functions. This article mainly introduces in detail the implementation of jquery interlaced color change effect. It has certain reference value. Interested friends can refer to it. I hope it can Help everyone.

The example in this article shares the specific code for jquery interlaced color display for your reference. The specific content is as follows

Rendering

Code


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
<script type="text/javascript">
$(function(){
$("tr:odd").attr("bgColor","#DD1C73");
$("tr:even").attr("bgColor","#875BE6");
})
</script>
<body>
<form id="form1" runat="server"> 
  <p> 
  <table width="300px"> 
      <tr><td>11111</td></tr> 
      <tr><td>22222</td></tr> 
      <tr><td>33333</td></tr> 
      <tr><td>44444</td></tr> 
      <tr><td>55555</td></tr> 
      <tr><td>55555</td></tr> 
  </table> 
 
  </p> 
  </form> 
</body>
</html>

A small function, have you learned it? Hurry up and give it a try.

Related recommendations:

JS control table interlaced color change implementation code display

JS implementation of the list page interlaced color change example code sharing

Pure JS code to realize interlaced color change and mouse move into highlight

The above is the detailed content of jquery simple implementation of interlaced color changing method. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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