BILL Carlisle
asked on
Percent highlighting of rows of a small report that works great in Chrome but not in IE
Hi all.. I have percent highlighting of rows of a small report that works great in Chrome but not in IE.
Chrome works with the below and show percentage when text was 86% it shows color for 86% of the table cell.
linear-gradient(to right, yellow "+$( this ).text()+", white 1%
IE doesn't show an error but shows no color
Thank you,
Bill
Chrome works with the below and show percentage when text was 86% it shows color for 86% of the table cell.
linear-gradient(to right, yellow "+$( this ).text()+", white 1%
IE doesn't show an error but shows no color
$(document).ready(function() {
$('table[summary="Progress"] td[headers="PERCENT_COMPLETE"]').each(function( index ) {
if( $( this ).text() != '0%' && $( this ).text() !='100%' ){
// Yellow console.log( index + ": " + $( this ).text() );
$( this ).parent().find("td:first").css("background","linear-gradient(to right, yellow "+$( this ).text()+", white 1%");
} else if( $( this ).text() =='100%' ){
// Green for 100%
$( this ).parent().children().css('background','green')
}
});
});
What would I use that would work in IE, Chrome, Firefox?
Thank you,
Bill
What version of IE and what version of jQuery? http://jquery.com/download/
ASKER
IE 11.0.9600
jquery-ui/1.8/ui/minified/ jquery.ui. tabs.min.j s
jquery.autotab.min.js
jquery-ui/1.8.22/themes/ba se/jquery- ui.min.css
jquery-ui/1.8/themes/base/ jquery.ui. tabs.css
jquery-ui/1.8/ui/minified/
jquery.autotab.min.js
jquery-ui/1.8.22/themes/ba
jquery-ui/1.8/themes/base/
ASKER
Ok, I pinpointed one td and used the gradient and it works, so I would say it is NOT the gradient code that is my problem
this works:
$('table[summary="Progress "] input[value="60"]').parent ().css('ba ckground', 'linear-gr adient(to right, yellow 46%, white 1%)')
So I would say it is my selector
$( this ).parent().find("td:first" )
does IE have a problem with find td:first ?
this works:
$('table[summary="Progress
So I would say it is my selector
$( this ).parent().find("td:first"
does IE have a problem with find td:first ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great answer! :)