Hi again,

I fiddled some more with this and added support for most of the
structural pseudo-classes in CSS3. Unfortunately this brought the size
up to 13Kb - so instead of attaching here I created a new ticket
(http://trac.mochikit.com/ticket/195).

As I said, only structural pseudo classes are supported, not dynamic
ones (like :hover and friends). Also some UI element pseudoclasses
like :enabled etc. although I'm not sure if they work correctly - as
well as the immensely useful ":not(...)" negation pseudo class.

For example, if you have a table and one line of the table has class
"current-line", then:
$$('#mytable tr.current-line')  will give you the current-line, and
$$('#mytable tr:not(.current-line)') will give you all other lines

Also of great use is the :nth-child and friends. I have support for
:nth-child(3)
:nth-child(odd)
:nth-child(even)
:nth-child(3n+1)  (gives you elements no. 4, 7, 10 etc.)

However, the an+b syntax is restricted to non-negative a and b - and b
is non-optional so you can't do "3n" for each 3rd element - but "3n+0"
will do the same thing. The reason for this is simply my lack of time,
certainly not that it can't be done.

Trac wouldn't allow me to add the test.html file since it was detected
as spam, and since that one is only 4K I'm attaching it here. Hope you
don't mind.

Arnar


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---
Title: untitled

Demo

Test originally from this blog entry.

Here are some links in a normal paragraph: Google, Google Groups. This link has class="blog": diveintomark

Everything inside the red border is inside a div with id="foo".

This is a normal link: Yahoo

This a is not inside a p

This link has class="blog": Simon Willison's Weblog

This link is inside a span, not directly child of p

try-me

Funny

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • some junk
  • Item 6
  • Item 7
  • Item 8
  • more junk

Reply via email to