id:vantguarde ããã HTML5 ã®ã»ã¯ã·ã§ã³ 3 ç®æ¡ãæ¸ããã¦ç´¹ä»ãã¦ãã¾ã
sectionの使い方とセクション三箇条 - vantguarde - web:g
- ã¹ã¿ã¤ã«ã·ã¼ããã¹ã¯ãªããã®é½åã«ã¯ä½¿ããªããã¨ããããã«ã¯divã使ããã¨ã
- article, aside, navãé©åãªå ´åã«ã¯ããã¡ãã使ãã¨ã
- ã»ã¯ã·ã§ã³ã®å é ã«è¦åºããèªç¶ã«åå¨ãã¦ãªãå ´åã«ã¯ä½¿ããªããã¨ã
ãã°ãããã§ããï¼
便ä¹ãã¦
ã»ã¯ã·ã§ã³ã®ã¢ã¦ãã©ã¤ã³ãæ±ãã JavaScriptï¼YAPC åå¤ç¥ã§ç´¹ä»ãããã¤ï¼ãå
¬éãã¾ã
http://amachang.sakura.ne.jp/misc/outliner.js
ãã® JavaScript ã¯
以ä¸ã®ã¢ã«ã´ãªãºã ããã®ã¾ã¾ JavaScript ã§å®è£
ãããã®ã«ãªã£ã¦ãã¾ã
4.4.11.1 Creating an outline
ã¾ã
以ä¸ã®ããã«ãä»æ§ã¨ã®å¯¾å¿é¢ä¿ãè¨è¿°ãã¦ããã¾ãã®ã§ãã¡ããè¦ã¦ã¿ã¦ãã ãããï¼
// http://amachang.sakura.ne.jp/misc/outliner.js function createOutline(document) { // Let current outlinee be null. (It holds the element whose outline is being created.) var outlinee = null; // Let current section be null. (It holds a pointer to a section, so that elements in the DOM can all be associated with a section.) var section = null; // Create a stack to hold elements, which is used to handle nesting. Initialize this stack to empty. var stack = []; var nextSectionId = 1; // As you walk over the DOM in tree order, trigger the first relevant step below for each element as you enter and exit it. (function (element) { var elementInfo = { element: element, outline: null }; if (trigger(elementInfo, true)) { return true; (snip)