On 11 Feb, 17:41, quirksmode <[EMAIL PROTECTED]> wrote:
> That's perfect!! Works really nicely. Just out of interest what does
> the blur() mean and why is it parent().parent(). Would that need to
> change if I introduced more td's?

when you call an event handler without arguments, generally you want
to trigger that event on the items you selected.
if you pass a function, for example
$(this).click(function(){
           blabla
});
the commands are executed when the user clicks upon the element.
if we say just
$(this).click();
we simulate the user clicking on it.
blur() deselects the item.

the .parent().parent() path is because first we select the clicked
element
$(this)
then we go up one level, first parent of the checkbox is the <td> that
contains it
.parent()
parent of the <td> is what we need: the <tr>
.parent()
and so on...
you will have to change it only if you put your checkbox in another
place.

> Is it possible to add a background image to the row? Would that have
> to be done with a style switch, or is there a command that adds it in?

you can use the css() method, and it can be done in the same line of
code

$(this).blur()
.parent()
.parent()
.css('background-image', 'url(path/to/image)')
//.children('td').not(':last')
.animate({opacity:"0.2"});

> Thanks btw

you're welcome :)

Reply via email to