Scott

You're the perfect editor. I am going to make these changes tonight.

I'm making up a set of these kind of beginner cheat sheets to help me learn.

What I think is really needed is a kind of How Do I...type of presentation
with a serious collection of the snippets we need to do frequently. Like one
area I would think would be great for beginners because it is well known and
a visual concept is three state buttons. I'd love a little example that
shows a few different way to make a button down, up and hover states appear.

Then I would diagram it like I did for the great table example.

Mitch  

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott Sauyet
Sent: Monday, July 23, 2007 6:42 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Click to Call a Function: The Movie


Mitchell Waite wrote:
> This looks better on a big screen but do I have this right?
> 
> http://www.whatbird.com/wwwroot/images/addClass.gif

The description of the Javascript is pretty good.  Dan had some good 
suggestions of how it might be done better, but your exposition of 
what's happening inside the script tag is great.

However, your description of the CSS is problematic.

The following has structure, and that structure can be analyzed, but for 
many purposes it needs to be treated as a whole:

     tr.foo td

This is a selector, and your notes that point to the "foo" to say that 
"class 'foo' styles the TR" is not really correct.  The whole line 
points to some elements that need to be styled, namely those TD elements 
that are inside TR elements with the class "foo".  Nothing in this rule 
will style the TR as a whole.  A separate rule, say

     tr.foo {
         background-image: /images/boat.png
         font-weight: bold;
     }

could be used to style the actual TR elements.

There's one other problem.  The note that says "and it makes each cell 
(TD) = yellow" is correct, but it's pointing to the wrong place.  You 
are pointing to the "td" in the selector; you should be pointing to the 
declaration "background-color: yellow;".  The selector chooses which 
elements you want to style.  It's the declarations that hold the actual 
styles to use.

Finally, in an exposition like this, it would probably help to indent 
the declarations inside their block.

The above sounds fairly critical, and I don't want to leave the 
impression that I think it's awful.  I think this is a great expository 
technique.  But if it's aimed at beginners, there should be no mistakes!

Cheers,

   -- Scott



Reply via email to