From b109376612a250dc42a1c6a6a92e12676fe761a9 Mon Sep 17 00:00:00 2001 From: P THE AWESOME Date: Tue, 7 Jan 2014 17:38:06 -0600 Subject: [PATCH] Add syntax specification for code in README --- README.markdown | 110 +++++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/README.markdown b/README.markdown index 88bfab2..f574a9f 100644 --- a/README.markdown +++ b/README.markdown @@ -47,37 +47,41 @@ Institute. Unlike JQuery UI tabs, the HTML markup for your tabs and content can be arranged however you want. At the minimum, you need a container, an unordered list of links for your tabs, and matching divs for your tabbed content. -
- -
-

Heading 1

-

This is the content of the first tab.

-
-
-

Heading 2

-

Stuff from the second tab.

-
-
-

Heading 3

-

More stuff from the last tab.

-
-
+```html +
+ +
+

Heading 1

+

This is the content of the first tab.

+
+
+

Heading 2

+

Stuff from the second tab.

+
+
+

Heading 3

+

More stuff from the last tab.

+
+
+``` ### The Javascript To enable back- and forward-button support for the users' browsers, be sure to include either the [jQuery HashChange plugin](http://benalman.com/projects/jquery-hashchange-plugin/) (recommended) or the [Address plugin](http://www.asual.com/jquery/address/docs/) before including the EasyTabs plugin. There is no other configuration required, it will just work! - - - - - +```html + + + + + +``` I varied the tab ids and names just to show you how flexible this is. There is no magic going on with this plugin; it's not trying to guess the order of your tabs or what tab is associated with which `
`. Just make the id of the content `
` match the href of the tab link. @@ -93,32 +97,34 @@ The only rules you need to follow are these: * the container div also contains content divs (for the tabbed content), each div has a unique id that matches the href property of a link in the unordered list Other than that, go nuts. The order of the elements does NOT matter. Your `
    ` could be before or after the content divs (or even between them). You can put non-tabbed content between the elements. It doesn't matter. The most common structure (for inspiration's sake) is something like this: - - div#tab-container ul > ( li > a[href="tab-1"], li > a[href="second-tab"] ) - div#tab-container div#tab-1 - div#tab-container div#second-tab - - +---------------------------------------------------------------------------+ - | div#tab-container | - | +---------------------------------------------------------------------+ | - | | ul | | - | | +-----------------------------+ +----------------------------+ | | - | | | li | | li | | | - | | | +-----------------------+ | | +----------------------+ | | | - | | | | a[href="tab-1"] | | | | a[href="second-tab"] | | | | - | | | +-----------------------+ | | +----------------------+ | | | - | | +-----------------------------+ +----------------------------+ | | - | +---------------------------------------------------------------------+ | - | | - | +---------------------------------------------------------------------+ | - | | div#tab-1 | | - | +---------------------------------------------------------------------+ | - | | - | +---------------------------------------------------------------------+ | - | | div#second-tab | | - | +---------------------------------------------------------------------+ | - | | - +---------------------------------------------------------------------------+ +```css +div#tab-container ul > ( li > a[href="tab-1"], li > a[href="second-tab"] ) +div#tab-container div#tab-1 +div#tab-container div#second-tab +``` +``` ++---------------------------------------------------------------------------+ +| div#tab-container | +| +---------------------------------------------------------------------+ | +| | ul | | +| | +-----------------------------+ +----------------------------+ | | +| | | li | | li | | | +| | | +-----------------------+ | | +----------------------+ | | | +| | | | a[href="tab-1"] | | | | a[href="second-tab"] | | | | +| | | +-----------------------+ | | +----------------------+ | | | +| | +-----------------------------+ +----------------------------+ | | +| +---------------------------------------------------------------------+ | +| | +| +---------------------------------------------------------------------+ | +| | div#tab-1 | | +| +---------------------------------------------------------------------+ | +| | +| +---------------------------------------------------------------------+ | +| | div#second-tab | | +| +---------------------------------------------------------------------+ | +| | ++---------------------------------------------------------------------------+ +``` -------------------------------------------------------------------------------------------