如何在Asp.net网格视图上应用鼠标效果? [英] how to apply mouse over effect on Asp.net grid-view?

查看:41
本文介绍了如何在Asp.net网格视图上应用鼠标效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为网格视图创建了一个CSS类,并为网格视图的行悬停创建了一个类,但它没有发生我想要的,没有鼠标悬停效果。



这是网格视图设置

I have made a CSS class for grid view and a class for grid view's row hover but it is not happening that I want, there is no mouse over effect.

this is grid view setting

<asp:GridView ID="grd" runat="server" Width="99%" EnableViewState="False" AutoGenerateColumns="False" CssClass="grid-view" DataKeyNames="Nt">// some bound filds here <alternatingrowstyle backcolor="#FFB6C1" /> <rowstyle backcolor="White" forecolor="Black" font-names="Verdana" />



Css Class


Css Class

.grid-view tr.normal:hover { background-color: Green; } 
.grid-view tr.alternate:hover { background-color: Green; }

推荐答案

添加 CssClass RowStyle AlternatingRowStyle 如下所示并尝试。

Add the CssClass to the RowStyle and AlternatingRowStyle like below and try.
<AlternatingRowStyle BackColor="#FFB6C1" CssClass="alternate" />

<RowStyle BackColor="White" ForeColor="Black" Font-Names="Verdana" CssClass="normal" />









1. 如何仅使用CSS在GridView行中显示鼠标悬停效果? [ ^ ]。

2. 代码显示仅使用CSS的GridView行中的鼠标悬停效果 [ ^ ]。



[/编辑]





1. How to display mouseover effect in GridView rows using only CSS?[^].
2. Code To Display Mouseover Effect In GridView Rows Using Only CSS[^].

[/Edit]


使用JQuery

=== =========

Using JQuery
============


document )。ready( function (){
(document).ready(function() {


这篇关于如何在Asp.net网格视图上应用鼠标效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆