[jQuery] Re: trying to do Math.min on 3 tds by excluding if one = 0

2010-01-02 Thread hollow
Thanks , great solution. i figured out on on my own that is quite different. i don't know which is the best i terms of performance. i create an array "numbArray" first of the elements then i do this. var index= $.inArray(0, numbArray); if(index== -1) { //Value not found in the array. }

[jQuery] Re: trying to do Math.min on 3 tds by excluding if one = 0

2010-01-01 Thread Šime Vidas
This shoud do the job... $("tr." + i).each(function() { var ithis = $(this).find("td:lt(3)").map(function() { if ($(this).html() === "0") { return null; } else { return this; } }).min();

[jQuery] Re: trying to do Math.min on 3 tds by excluding if one = 0

2010-01-01 Thread hollow
Hi min() is part of jquery calculation plugin. if i use var xmin = Math.min(x1, x2, x3) example var xmin = Math.min(5, 0, 3) the result will be 0 and i don't want that result. i would like to have 3 as the best result. example: compare prices that are in a database, but you haven't a price for th

[jQuery] Re: trying to do Math.min on 3 tds by excluding if one = 0

2009-12-31 Thread Šime Vidas
I'm not sure what youre trying to do here... but the jQuery object does not contain the min() method as a property. To use the Math.min method, you give the values as arguments... var xmin = Math.min(x1, x2, x3);