04.02.2013 Views

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 To add the tabbed panels widget to your web page, insert the following div tag where you want the accordion to<br />

appear on the page:<br />

<br />

<br />

6 To add tabs to the tabbed panel, insert a ul class="TabbedPanelsTabGroup" tag inside the div<br />

id="TabbedPanels1"... tag, and an li class="TabbedPanelsTab" tag for each tab to add, as follows:<br />

<br />

<br />

Tab 1<br />

Tab 2<br />

Tab 3<br />

Tab 4<br />

<br />

<br />

The preceding code adds four tabs to the widget. You can add unlimited tabs.<br />

7 To add a content area (or panel) for each of the tabs, insert a div class="TabbedPanelsContentGroup"<br />

container tag after the ul tag, and a div class="TabbedPanelsContent" tag for each content panel, as follows:<br />

<br />

<br />

Tab 1<br />

Tab 2<br />

Tab 3<br />

Tab 4<br />

<br />

<br />

Tab 1 Content<br />

Tab 2 Content<br />

Tab 3 Content<br />

Tab 4 Content<br />

<br />

<br />

Insert the content between the opening and closing TabbedPanelsContent tags (for example, Tab 1 Content,as<br />

in the preceding example). The content can be any valid HTML code, including HTML form elements<br />

8 To initialize the <strong>Spry</strong> tabbed panels object, insert the following script blockaftertheHTMLcodefortheTabbed<br />

Panels widget:<br />

<br />

. . .<br />

<br />

<br />

var TabbedPanels1 = new <strong>Spry</strong>.Widget.TabbedPanels("TabbedPanels1");<br />

<br />

SPRY<br />

<strong>User</strong> <strong>Guide</strong><br />

The new JavaScript operator initializes the Tabbed Panels widget object, and transforms the div content with the ID<br />

of TabbedPanels1 from static HTML code into an interactive tabbed panels object. The <strong>Spry</strong>.Widget.Tabbed-<br />

Panels method is a constructor in the <strong>Spry</strong> framework that creates tabbed panels objects. The information necessary<br />

to initialize the object is contained in the <strong>Spry</strong>TabbedPanels.js JavaScript library that you linked to at the beginning<br />

of this procedure.<br />

28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!