Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Contributor
2622 Points
589 Posts
Feb 25, 2011 04:04 AM|LINK
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> var style; var Clickedindex = 0; var mouseoverRowColor = "#dadada"; var oddRowColor = "#ecf5ff"; var evenRowColor = "#ffffff"; var selectedRowColor = "yellow"; $(document).ready(function() { $('[id*=GridView1] tbody tr+tr:even').mouseover(function() { if ($(this).index() != Clickedindex || Clickedindex == 0) { $(this).removeAttr("style"); $(this).css("background-color", mouseoverRowColor); } }).mouseout(function() { if ($(this).index() != Clickedindex || Clickedindex == 0) { $(this).css("background-color", oddRowColor); } }); $('[id*=GridView1] tbody tr+tr:odd').mouseover(function() { if ($(this).index() != Clickedindex || Clickedindex == 0) { $(this).removeAttr("style"); $(this).css("background-color", mouseoverRowColor); } }).mouseout(function() { if ($(this).index() != Clickedindex || Clickedindex == 0) { $(this).css("background-color", evenRowColor); } }); $('[id*=GridView1] tbody tr+tr').click(function() { if (Clickedindex % 2 == 0 && Clickedindex != 0) { $("tr:eq(" + Clickedindex + ")").css("background-color", evenRowColor); } else if (Clickedindex % 2 != 0 && Clickedindex != 0) { $("tr:eq(" + Clickedindex + ")").css("background-color", oddRowColor); } $(this).removeAttr("style"); Clickedindex = $(this).index(); $(this).css("background-color", selectedRowColor); }); }); </script> Plz Just try this the issue is with the new jquery and let me know
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
RaviSM
Contributor
2622 Points
589 Posts
Re: gridview mousehover AlternatingRowStyle
Feb 25, 2011 04:04 AM|LINK
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var style;
var Clickedindex = 0;
var mouseoverRowColor = "#dadada";
var oddRowColor = "#ecf5ff";
var evenRowColor = "#ffffff";
var selectedRowColor = "yellow";
$(document).ready(function() {
$('[id*=GridView1] tbody tr+tr:even').mouseover(function() {
if ($(this).index() != Clickedindex || Clickedindex == 0) {
$(this).removeAttr("style");
$(this).css("background-color", mouseoverRowColor);
}
}).mouseout(function() {
if ($(this).index() != Clickedindex || Clickedindex == 0) {
$(this).css("background-color", oddRowColor);
}
});
$('[id*=GridView1] tbody tr+tr:odd').mouseover(function() {
if ($(this).index() != Clickedindex || Clickedindex == 0) {
$(this).removeAttr("style");
$(this).css("background-color", mouseoverRowColor);
}
}).mouseout(function() {
if ($(this).index() != Clickedindex || Clickedindex == 0) {
$(this).css("background-color", evenRowColor);
}
});
$('[id*=GridView1] tbody tr+tr').click(function() {
if (Clickedindex % 2 == 0 && Clickedindex != 0) {
$("tr:eq(" + Clickedindex + ")").css("background-color", evenRowColor);
}
else if (Clickedindex % 2 != 0 && Clickedindex != 0) {
$("tr:eq(" + Clickedindex + ")").css("background-color", oddRowColor);
}
$(this).removeAttr("style");
Clickedindex = $(this).index();
$(this).css("background-color", selectedRowColor);
});
});
</script>
Plz Just try this the issue is with the new jquery and let me know
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
Custom watermark on PDF
Thanks and Regards
Ravi Mathpal