[Noisebridge WebDev] [FrontEnd] Class for 2013-08-26: ClassName Swap, Language Review, RTFM, by Garrett Smith

Garrett Smith dhtmlkitchen at gmail.com
Tue Aug 27 22:58:02 UTC 2013


Review:
Class for 2013-08-26 (Monday): ClassName Swap, Language Review, RTFM,
by Garrett Smith

https://noisebridge.net/wiki/Frontend_Web_Development/Notes#Class_for_2013-08-26:_RTFM_and_STFW.2C_Garrett_Smith

Lesson: CSS ClassName Swap

By changing an element's className multiple styles can be changed at one time.

Using the descendant selector, and changing the className of an
ancestor element, multiple elements can be updated simultaneously,
with a modicum of highly efficient code.

For Styles, replace a loop that applies styles to descendants by
adding a class token to the nearest common ancestor.

Also a brief review of ECMAScript and links to the FAQ and pertinent specs.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com


More information about the WebDev mailing list