使用jquery突出显示页码 [英] highlight the page numbers using jquery
问题描述
- 场景
i制作了一个自定义页面......并显示了gridview ...
- 使用链接按钮显示页码。我正在使用转发器绑定链接按钮..因此,当页面呈现时,这些链接按钮将显示为页码。
--aspx page
--scenario
i have made a custom page ...and displaying the gridview...
--the page numbers are displayed using the link button..I am using repeater to bind the link button ..so that these link button will be displayed as page number when page renders.
--aspx page
</asp:GridView>
<br />
<asp:Repeater ID="RepeaterForPaging" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkbtnPage" runat="server" Text='<%#Eval("Text") %>' CommandArgument='<%# Eval("Value") %>'
Enabled='<%# Eval("Enabled") %>' OnClick="Page_Changed_click">
</asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
- 我正在尝试这个。当我将鼠标移到页码上时。银色的颜色很高。
--so i was trying this. when i move my mouse over the page number. it will higlight with silver color.
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
.selected
{
background-color: #A1DCF2;
}
.hover
{
background-color: Silver;
}
</style>
---
---
<script type="text/javascript">
$(document).ready(function(){
$('[id*=lnkbtnPage]').mouseover(function(){
$(this).addclass("hover");
});
$('[id*=lnkbtnPage]').mouseout(function(){
$(this).removeClass("hover");
});
});
但这不起作用。当我在页码上移动鼠标时。我在页面上收到错误。
请帮忙。我做错了什么?
But this is not working. when i move my mouse on the page numbers. I get error on page.
Please help. Where i am doing wrong ?
推荐答案
(document).ready(function(){
(document).ready(function(){
(' [id * = lnkbtnPage]')。mouseover(function(){
('[id*=lnkbtnPage]').mouseover(function(){
( this )。addclass( hover);
});
(this).addclass("hover"); });
这篇关于使用jquery突出显示页码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!