zoukankan
html css js c++ java
JQuery实现表格隔行换色,鼠标移动变色,点击选择变色
Code
<%
@ Page Language
=
"
C#
"
AutoEventWireup
=
"
true
"
Codebehind
=
"
WebForm1.aspx.cs
"
Inherits
=
"
WebApplication14.WebForm1
"
%>
<!
DOCTYPE html PUBLIC
"
-//W3C//DTD XHTML 1.0 Transitional//EN
"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
"
>
<
html xmlns
=
"
http://www.w3.org/1999/xhtml
"
>
<
head runat
=
"
server
"
>
<
title
>
无标题页
</
title
>
<
script language
=
"
javascript
"
type
=
"
text/javascript
"
src
=
"
jquery.js
"
></
script
>
<
script language
=
"
javascript
"
type
=
"
text/javascript
"
>
var color;
$(document).ready(function()
{
$(
"
#GridView1 tr
"
).attr(
"
selected
"
,
"
0
"
);
$(
"
#GridView1 tr:even
"
).not(
"
:first
"
).css(
"
background
"
,
"
red
"
);
$(
"
#GridView1 tr:odd
"
).css(
"
background
"
,
"
yellow
"
);
$(
"
#GridView1 tr
"
).not(
"
:first
"
).click(function()
{
$(
"
#GridView1 tr:even
"
).not(
"
:first
"
).css(
"
background
"
,
"
red
"
);
$(
"
#GridView1 tr:odd
"
).css(
"
background
"
,
"
yellow
"
);
var selected
=
$(
this
).attr(
"
selected
"
);
if
(selected
==
1
)
{
$(
this
).attr(
"
selected
"
,
"
0
"
);
color
=
$(
this
).css(
"
background
"
);
}
else
{
$(
"
#GridView1 tr
"
).attr(
"
selected
"
,
"
0
"
);
$(
this
).attr(
"
selected
"
,
"
1
"
);
$(
this
).css(
"
background
"
,
"
green
"
);
color
=
$(
this
).css(
"
background
"
);
}
}
).mouseover(function()
{
color
=
$(
this
).css(
"
background
"
);
$(
this
).css(
"
background
"
,
"
green
"
);
}
).mouseout(function()
{
$(
this
).css(
"
background
"
,color);
}
);
}
);
</
script
>
</
head
>
<
body
>
<
form id
=
"
form1
"
runat
=
"
server
"
>
<
div
>
&
nbsp;
<
asp:TextBox ID
=
"
TextBox1
"
runat
=
"
server
"
></
asp:TextBox
>
<
asp:Button ID
=
"
Button2
"
runat
=
"
server
"
Text
=
"
Button
"
/>&
nbsp;
<
br
/>
<
br
/>
<
br
/>
<
asp:Button ID
=
"
Button1
"
runat
=
"
server
"
Text
=
"
Button
"
/><
asp:GridView ID
=
"
GridView1
"
runat
=
"
server
"
AutoGenerateColumns
=
"
False
"
DataSourceID
=
"
SqlDataSource1
"
EmptyDataText
=
"
没有可显示的数据记录。
"
>
<
Columns
>
<
asp:BoundField DataField
=
"
User_id
"
HeaderText
=
"
User_id
"
SortExpression
=
"
User_id
"
/>
<
asp:BoundField DataField
=
"
User_name
"
HeaderText
=
"
User_name
"
SortExpression
=
"
User_name
"
/>
<
asp:BoundField DataField
=
"
User_max_borrow
"
HeaderText
=
"
User_max_borrow
"
SortExpression
=
"
User_max_borrow
"
/>
</
Columns
>
</
asp:GridView
>
<
asp:SqlDataSource ID
=
"
SqlDataSource1
"
runat
=
"
server
"
ConnectionString
=
"
<%$ ConnectionStrings:QIConnectionString1 %>
"
ProviderName
=
"
<%$ ConnectionStrings:QIConnectionString1.ProviderName %>
"
SelectCommand
=
"
SELECT [User_id], [User_name], [User_max_borrow] FROM [Book_user]
"
>
</
asp:SqlDataSource
>
</
div
>
</
form
>
</
body
>
</
html
>
qishichang
查看全文
相关阅读:
unable to retrieve container logs for docker kubernetes
Restart container within pod
Kubernetes1.3:POD生命周期管理
Options of the DB storage of prometheus
prometheus重启hang住问题记录
prometheus交流资源
nc 从服务器上传下载文件
负载均衡监控需求
prometheus消耗内存问题
10.Docker 镜像使用
原文地址:https://www.cnblogs.com/qishichang/p/1339328.html
最新文章
freepbx对接gms网关
freepbx的SIP通话客户端X-lite Yate eyeBeam Linphone
安装freepbx后创建sip分机
zabbix邮件内容乱码与邮件内容为附件解决办法
centos7设置SSH安全策略–指定IP登陆
阿里云使用镜像安装freepbx
centos7邮件服务器SSL配置
多域名邮件服务器配置
centos7系统日志时间与系统时间相差8小时
ubuntu关闭时间同步与centos更改时间
热门文章
Repository模式中,Update总是失败及其解析(转)
基于DDD的现代ASP.NET开发框架--ABP系列文章总目录(转)
T4系列文章之2:T4工具简介、调试以及T4运行原理(转)
负载均衡基础知识(转)
Nginx upstream的5种权重分配方式(转)
经典的SQL语句面试题(转)
asp.net web api 安装swagger
带你快速进入.net core的世界(转)
分布式事务,EventBus 解决方案:CAP【中文文档】(转)
我大中华微软MVP中国区人才库(转)
Copyright © 2011-2022 走看看