[jQuery] Re: Interacting with TR an TD

2007-04-28 Thread Michael Geary
From: Feed Thanks Ian, it seem to be working perfectly. I just have one more question: isn't there a big performance impact using this piece of code? It looks like the page it taking a while do load, but I guess you have to choose between the time the page takes to load and the time

[jQuery] Re: Interacting with TR an TD

2007-04-28 Thread Ian Struble
[...] isn't there a big performance impact using this piece of code? That's why I said play around a bit ;^) I threw that idea out there mostly because it is sort of inside-out from style that I would probably have tried first and it was just building off the previous example. That sort of

[jQuery] Re: Interacting with TR an TD

2007-04-28 Thread Michael Geary
From: Ian Struble Just out of curiosity is there a way to break out while iterating with .each()? Again building on the previous example (Mike's #2 this time): $(function() { $('tr').each( function() { var allEmpty = true; $('td', this).each(funcion() {

[jQuery] Re: Interacting with TR an TD

2007-04-28 Thread Ian Struble
On 4/28/07, Michael Geary [EMAIL PROTECTED] wrote: Indeed there is, return false. See my #1 example which is similar to yours... I should have used my eyes before I started typing. My question's code is almost exactly what you wrote, just cosmetic differences. I missed the assignment +

[jQuery] Re: Interacting with TR an TD

2007-04-28 Thread Karl Swedberg
Michael! So great to see you on the list again! You have a brilliant mind, and I always learn something new whenever you post. I was beginning to wonder where you've been. Glad to have you back. :-) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Apr

[jQuery] Re: Interacting with TR an TD

2007-04-28 Thread Ⓙⓐⓚⓔ
nbsp; is html. not javascript! Does IE do this any differently than firefox? ?xml version=1.0 encoding=utf-8 ? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head title

[jQuery] Re: Interacting with TR an TD

2007-04-27 Thread Karl Swedberg
This should do the trick, although there's probably a way to do it without the .each(), too. $(document).ready(function() { $('td').each(function() { var $this = $(this); if ($this.html() == 'nbsp;') { $this.parent().addClass('some-class'); } }); }); --Karl

[jQuery] Re: Interacting with TR an TD

2007-04-27 Thread Feed
Feed wrote: Hello all, I'm getting used to the excellent jQuery library and I need some help of more experienced programmers. I have this simple table: table class=table tr tdcontent/td tdcontent/td tdcontent/td /tr tr

[jQuery] Re: Interacting with TR an TD

2007-04-27 Thread Ian Struble
Building on Karl's example and your new all-td's-must-be-empty requirement; mark all the TR's with a target class then sweep through the TD's and get rid of the target class if you find a td that is not empty. Play around a bit and see what else you can come up with. Ian

[jQuery] Re: Interacting with TR an TD

2007-04-27 Thread Feed
Thanks Ian, I'll play around with this piece of code! jQuery is really helping me in my project, it's awesome. On Apr 28, 1:20 am, Ian Struble [EMAIL PROTECTED] wrote: Building on Karl's example and your new all-td's-must-be-empty requirement; mark all the TR's with a target class then sweep

[jQuery] Re: Interacting with TR an TD

2007-04-27 Thread Feed
Thanks Ian, it seem to be working perfectly. I just have one more question: isn't there a big performance impact using this piece of code? It looks like the page it taking a while do load, but I guess you have to choose between the time the page takes to load and the time you take to do