'position().top' is null or not an object?-Collection of common programming errors
Your .css() arguments are backwards; it should be .css(, )
$('#pnlAdd .modalDialog').css("top", $("tr [style*=Blue]").position().top + "px");
Also, .position()
will return null if $("tr [style*=Blue]")
doesn’t return anything, causing an error. Try checking its length first.
var elements = $("tr [style*=Blue]");
if (elements.length) {
$('#pnlAdd .modalDialog').css("top", elements.position().top + "px");
}
EDIT NOTE Firefox use initial caps on the colors (Blue) but IE use all lowercase (blue).