In a Gridview I'm adding a row CSS class depending on certain criteria. This class adds an inset box shadow to the border of the row, and it works fine in FireFox. In IE it adds the row shadow, but it adds it at the cell level so the cell borders on the left and right of a cell is highlighted as well. This shows each cell border with the insert glow when I only want the row highlighted.
Chrome acts like IE, but with out the inset box shadow. It only colors the border.
As I said, it looks good in FF. Any ideas on how to correct this in IE ... and Chrome, where the box shadow only colors the border, but I can live with that.
Css Class
.rowGlow
{
border-collapse:separate;
border-color:#ff0000;
box-shadow:inset 0 0 3px 1px #ff0000;
-moz-box-shadow:inset 0 0 3px 2px #ff0000;
-webkit-box-shadow:inset 0 0 3px 2px #ff0000;
}
Row Tag
<tr class="rowGlow" style="color:#333333;background-color:#F7F6F3;">
jQuery to add css class to row, depending on a hidden value in the row
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args) {if (args.get_error() == undefined) {alertTest();}}
function alertTest() {
$(document).ready(function () {
$('tr').each(function () {
if ($(this).find('input[type=hidden]').val() == 'False') {
var du = <%= DateUpdates() %>;
if(du){$(this).addClass('rowGlow');}
}
});
});
}
alertTest();
This is what I ended up with. Updated jQuery to this to add two additional CSS class', one for the first TD and one for the last TD:
$(this).addClass('rowGlow').find('td:first-child').addClass('firstCell');
$(this).find('td:last-child').addClass('lastCell');
.rowGlow
{
-webkit-box-shadow:inset 0 -3px 3px -1px #ff0000,inset 0px 3px 3px -1px #ff0000;
-moz-box-shadow: inset 0 -2px 3px -1px #ff0000,inset 0px 2px 3px -1px #ff0000;
box-shadow: inset 0 -3px 3px -1px #ff0011,inset 0px 3px 3px -1px #ff0000;
}
.firstCell
{
-webkit-box-shadow: inset 3px 0px 3px -2px #ff0000;
-moz-box-shadow: inset 3px 0px 3px -2px #ff0000;
box-shadow: inset 3px 0px 3px -2px #ff0000;
}
.lastCell
{
-webkit-box-shadow: inset -3px 0px 3px -2px #ff0000;
-moz-box-shadow: inset -3px 0px 3px -2px #ff0000;
box-shadow: inset -3px 0px 3px -2px #ff0000;
}
<!-- For IE8 and lower I have this conditional -->
<!--[if lt IE 9]>
<style type="text/css">
.rowGlow {
background-color: #F9ACAA !important;
/* color: #000!important; */
}
</style>
<![endif]-->