Skip navigation
Currently Being Moderated

Spry Accordian Tabs Question

Sep 23, 2012 12:08 PM

Tags: #spry #accordian_menu

Hi

 

I'm trying to create a spry accordian menu for a navbar and am having some trouble.

This is the first time I've tried it so I would appreciate any help.

 

The Client would like the tabs to be:

 

Home

Students

   High School Students

   College Students

Professionals

Parents/Educators

Seminars

Bio

Q  & A Blog

Testimonials

 

So all they would like High School Students and College Students to be child tabs underneath the parent tabs and all other tabs to be parent tabs.

They asked for a spry accordian.

They want the nav bar to be on the left.

 

Here is the link to the website online:

 

http://www.elynncohen.com/index2spry2.html#

 

and here are my questions:

 

1. The spry accordian has a box around it on mouse down but I can't figure out how to get rid of it. I've checked all the CSS rules for the spry accordian and none of them seem to have rules around them.

 

2. All the tabs have a content area underneath them and we only want content areas underneath the student tab. You see how it goes when you click on any of the tabs, you get a little thing that says content 1, 2 etc. I tried deleting them in the code and the page goes completely crazy when I do and the nav bar areas stretch all the way across the page.

 

3. I can't figure out how to get the child tabs (which would be the tabs under students which say high school and college) to have two tabs. You will see that it does have the high school tab there now. When I try cutting and pasting the code to try to get two tabs, it does not work. The spry accordian framework only creates one content area under each tab.

 

4. I'd like the child tabs to have a narrower height than the parent tabs, and be indented so that they will clearly be set off and different than the parent tabs.

 

Any help would be much appreciated!

 

Thanks!!!

 

 

 

Here is my code:

 

<!DOCTYPE HTML>

<html>

<head>

<meta charset="UTF-8">

<title>Your Career Direction Career and College Counseling</title>

<meta name="Keywords" content="career counseling, college counseling, job search, career choice, college options, career options, work, jobs, new opportunities, career change, new career, new job" />

<meta name="Description" content="Your Career Direction :: Career and College Counseling" "Considering your college choices & career options" "Preparing for the world of work after college" "Seeking a new position to further your career"

"In-transition and considering new opportunities"

"Seeking to make a significant and meaningful career change"  />

<meta name="Publisher" content="Your Career Direction, LLC" />

<meta name="Copyright" content="Copyright 2012, Your Career Direction, LLC. All rights reserved." />

<meta name="Author" content="Lisa Mark" />

<meta name="Language" content="en-US" />

<meta name="distribution" content="global" />

<meta name="revisit-after" content="10 days" />

<meta name="Robots" content="All" />

<link rel="Index" href="index.html" />

<link rel="Site Map" href="sitemap.html" />

<script type="text/javascript" src="//use.typekit.net/ifb2bte.js"></script>

<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>

<script type="text/javascript">try{Typekit.load();}catch(e){}</script>

<style type="text/css">

<!--

body {

    margin: 0;

    padding: 0;

    color: #000;

    font-size: 100%;

    line-height: 1.4;

    background-image: url(images/background.gif);

    background-repeat: repeat;

}

 

/* ~~ Element/tag selectors ~~ */

ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */

    padding: 0;

    margin: 0;

}

h1, h2, h3, h4, h5, h6, p {

    margin-top: 0;     /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */

    padding-right: 15px;

    padding-left: 15px;

}

.container .sidebar1 h3 {

    padding-left: 0px;

    color: #C60651;

    font-size: x-large;

}

h1 strong {

    color: #C60651;

    font-size: 90%;

    font-family: "Binary ITC Bold";

}

h1 strong em {

}

a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */

    border: none;

}

 

/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */

a:link {

    color:#414958;

    text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */

}

a:visited {

    color: #4E5869;

    text-decoration: underline;

}

a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */

    text-decoration: none;

}

 

/* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */

.container {

    width: 80%;

    max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */

    min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */

    background: #FFF; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */

    margin-top: 0;

    margin-bottom: 0;

    margin-right: auto;

    margin-left: auto;

    border-right-width: thick;

    border-left-width: thick;

    border-right-style: solid;

    border-left-style: solid;

    border-right-color: #C60651;

    border-left-color: #C60651;

}

 

/* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */

.header {

    padding-top: 40px;

}

#Quote {

    float: right;

    clear: left;

    margin-right: 1%;

}

 

/* ~~ These are the columns for the layout. ~~

 

1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

 

2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.

 

3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.

 

4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.

 

*/

.sidebar1 {

    float: left;

    width: 15%;

    padding-bottom: 10px;

    margin-top: 40px;

    margin-left: 25px;

    background-color: #FFF;

    font-family: museo-sans;

arial;

    max-width: 200px;

    min-width: 180px;

}

.content {

    float: left;

    padding-top: 10px;

    padding-bottom: 10px;

    padding-left: 10;

    font-family: museo-sans;

arial;

    margin-top: 40px;

    padding-right: 10px;

    width: 50px;

    font-size: large;

}

.container .content p {

    padding-top: 0px;

}

.sidebar2 {

    float: left;

    width: 20%;

    background-color: #D3CCB2;

    margin-top: 40px;

    padding-top: 10px;

    border-top-color: #FFF;

    border-right-color: #FFF;

    border-bottom-color: #FFF;

    border-left-color: #FFF;

    border-right-width: 5px;

    font-family: museo-sans;

arial;

    font-size: 90%;

    right: 12%;

}

 

/* ~~ This grouped selector gives the lists in the .content area space ~~ */

.content ul, .content ol {

    padding-top: 0px;

    padding-right: 25px;

    padding-bottom: 15px;

    padding-left: 40px;

    font-family: museo-sans; arial;

    font-size: 100%;

    color: #666;

}

.container .content p {

    font-family: museo-sans;

arial;

    padding-top: 0px;

    padding-left: 17px;

    padding-bottom: 0px;

}

#Quote {

    float: right;

    clear: both;

}

 

/* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */

ul.nav {

    list-style: none; /* this creates the space between the navigation on the content below */

    font-family:museo-sans; arial;

    line-height: 250%;

}

.nav {

    font-family: museo-sans;

arial;

    padding-left: 0px;

}

ul.nav li {

    font-family: museo-sans; arial;

    padding-bottom: 10px;

}

ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */

    display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */

    text-decoration: none;

    color: #333333;

    background-color: #FFF;

    font-family: museo-sans; arial;

    padding-top: 5px;

    padding-right: 5px;

    padding-bottom: 10px;

    padding-left: 15px;

}

ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */

    color: #C60651;

    font-family:museo-sans; arial;

    background-color: #FFF;

    background-image: url(images/navbar2.gif);

    padding-bottom: 10px;

}

.content img {

}

 

/* ~~The footer ~~ */

.footer {

    position: relative;/* this gives IE6 hasLayout to properly clear */

    clear: both; /* this clear property forces the .container to understand where the columns end and contain them */

    padding-top: 0px;

    padding-right: 0;

    padding-bottom: 10px;

}

 

/* ~~miscellaneous float/clear classes~~ */

.fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

    float: right;

    margin-left: 8px;

}

.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */

    float: left;

    margin-right: 8px;

}

.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */

    clear:both;

    height:0;

    font-size: 1px;

    line-height: 0px;

}

.container .content {

    width: 50%;

    font-size: large;

    font-family: museo-sans; arial;

}

#footer {    width: 100%;

    background-color: #FFF;

}

.container .sidebar2 h4 img {

    padding-left: 20px;

    padding-top: 0px;

}

.sidebar2 p img {

    border: medium solid #C60651;

}

#Insert_logo2 {

    border-top-width: 4px;

    border-right-width: 4px;

    border-bottom-width: 4px;

    border-left-width: 4px;

    border-top-color: #fff;

    border-right-color: #fff;

    border-bottom-color: #fff;

    border-left-color: #fff;

}

.container .content p .content strong {

    font-family: museo-sans; arial;

}

.container .content .content {

    font-family: museo-sans; arial;

}

.container .content ul li strong {

    font-family: museo-sans;

arial;

    font-size: 95%;

    line-height: 150%;

    list-style-type: disc;

}

.container .content ul {

}

test {

    font-family: "Binary ITC Bold";

}

.container .sidebar2 p img {

    margin-right: auto;

    margin-left: auto;

    border-top-width: medium;

    border-right-width: medium;

    border-bottom-width: medium;

    border-left-width: medium;

    border-top-color: #C60651;

    border-right-color: #C60651;

    border-bottom-color: #C60651;

    border-left-color: #C60651;

}

li strong {

    line-height: 130%;

    list-style-type: circle;

    color: #978980;

    }

.container .content ul {

}

.container .sidebar1 .nav {

    margin-top: 10px;

    margin-bottom: 10px;

}

.sidebar1 .nav li {

    padding-bottom: 10%;

}

.nav li a {

    background-image: url(images/navbar2.gif);

    background-repeat: no-repeat;

    background-position: right center;

    left: auto;

    right: auto;

    clip: rect(auto,auto,auto,auto);

}

.container .sidebar1 .nav li a {

}

.container .sidebar1 h6 {

    padding: 0px;

    color: #000000;

}

#footer h3 strong {

    font-size: 60%;

    color: #978980;

}

.container .content p {

    padding-right: 0%;

    padding-left: 0%;

    font-size: 85%;

}

.container .sidebar2 p {

    padding-right: 8%;

    padding-left: 8%;

    padding-top: 5px;

}

#Insert_logo2 #Insert_logo2 {

    padding-left: 15px;

}

.container .content ul {

    color: #C60651;

}

h6 {

    color: #978980;

    font-family: museo-sans;

arial;

    font-size: 82%;

    padding-left: 20%;

    text-align: left;

    text-indent: 8px;

}

.nav li a {

    padding-bottom: 10px;

}

h8 {

    font-family: museo-sans; arial;

    font-size: 100%;

}

h4 {

    font-family: museo-sans;

arial;

    font-size: 100%;

    color: #C60651;

    padding-left: 17px;

    padding-top: 5px;

    padding-bottom: 0px;

}

.container .content p {

    padding-left: 17px;

    padding-right: 30px;

}

.sidebar1 h8 strong {

    font-size: 80%;

    font-family:museo-sans; arial;

}

.container .sidebar1 h7 {

    font-size: 40%;

    color: #978980;

}

h7 {

    font-family: museo-sans; arial;

    font-size: 15%;

}

.container .sidebar1 h8 {

    font-family: museo-sans; arial;

}

.sidebar2 p img {

        max-width: 100%;

}

.container .content img {

    padding-left: 3%;

}

img {

    position: static;

    text-align: left;

}

body,td,th {

    font-family: museo-sans; arial;

}

h5 {

    font-size: 150%;

    color: #C60651;

    padding-left: 0px;

    font-family:museo-sans; arial;

   

.container .content p {

    padding-left: 17px;

    padding-right: 30px;

    font-size: 87%;

}

.container .sidebar2 p {

    font-size: 90%;

}

.container .sidebar1 .nav li {

    font-family: museo-sans;

arial;

}

.container .sidebar1 .nav li a {

    padding-left: 0px;

    margin-bottom: 0px;

    height: 30px;

}

li a {

    padding-left: 2px;

}

-->

</style><!--[if lte IE 7]>

<style>

.content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */

ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */

</style>

<![endif]-->

<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">

</head>

 

<body><script type="text/javascript">

function pageWidth() {

return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;

}

function pageHeight() {

return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;

}

 

</script>

 

<div class="container">

  <div class="header"><!-- end .header -->

    <p class="clearfloat"><a href="#index.html" id="Insert_logo2"><img src="images/YCD-logo-tag-RGB-web-SM.gif" alt="Your Career Direction Logo" name="Insert_logo" width="50%" id="Insert_logo2" style="background: #FFF

    ; display:block;" /></a></p>

    <div id="Quote"><img src="images/quote.gif" alt="Choose a job you love" width="355" height="81"></div>

    <p class="clearfloat"> </p>

</div>

  <div class="sidebar1">

    <ul class="nav">

      <li>

        <div id="Accordion1" class="Accordion" tabindex="0">

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Home</a></div>

            <div class="AccordionPanelContent">Content 1</div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Students</a></div>

            <div class="AccordionPanelContent"><a href="#">High School</a></div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Professional</a></div>

            <div class="AccordionPanelContent">Content 3</div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Parent/Educator</a></div>

            <div class="AccordionPanelContent">Content 4</div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Seminars</a></div>

            <div class="AccordionPanelContent">Content 5</div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Bio</a></div>

            <div class="AccordionPanelContent">Content 6</div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Q &amp; A Blog</a></div>

            <div class="AccordionPanelContent">Content 7</div>

          </div>

          <div class="AccordionPanel">

            <div class="AccordionPanelTab"><a href="#">Testimonials</a></div>

            <div class="AccordionPanelContent">Content 8</div>

          </div>

        </div>

      </li>

    </ul>

   

  </div>

  <div class="content">

<p>Given today's competitive job market, global economy, and changed corporate culture,

we can no longer depend upon others to ensure our professional futures. Choosing or

changing your career direction requires self-reflection, career education and an action plan.</p>

<img src="images/Whether-you-are-.gif" alt="Whether you are considering your college choices and career options" width="197" height="31" align="left">

<ul>

      <br><br><li><strong>Considering your college choices &amp; career options</strong></li>

      <li><strong>Preparing for the world of work after college</strong></li>

      <li><strong>Seeking a new position to further your career</strong></li>

      <li><strong>In-transition and considering new opportunities</strong></li>

      <li><strong>Seeking to make a significant and meaningful career</strong> <strong>change</strong></li>

    </ul>

   

<img src="images/Onethingisforsureraster.gif" width="352" height="49" alt="One thing is for sure, we all want to direct our own careers, our own lives!">

<br><p> Building a successful and rewarding career requires linking your interests, education and experience with employment trends, growth industries, and career choices. It takes making smart decisions about your college major, vocational training and continuing education options. With enthusiasm, persistence and top notch job search skills, you can succeed in finding a path to career that is right for you.</p>

<p> We are your advocate. We listen, assess, strategize, inspire, counsel, and network on your behalf. With a personalized, holistic approach, we'll work with you to help you create an action plan; a path designed to get you to where you want to go and become what you want to be.</p>

<img src="images/yourcareerourpassionraster.gif" width="441" height="20" alt="At Your Career Direction, YOUR career is our passion!"> </div>

  <div class="sidebar2">

    <p><img src="images/Counselingastudent.gif" width="100%" alt="Lisa Mark counseling a student"></p>

    <p>Our mission is to help you explore, choose and create your direction for an exciting and rewarding career path.</p>

     <p>We incorporate our experience with today's job market and career counseling expertise with your passions and interests. We'll introduce you to new career ideas, target companies and generate job and internship opportunities for you.</p>

     <p>We provide step by step guidance to ensure your success during the college application, job interview

and decision making process.

</p>

 

</div>

  <div class="footer">

    <div id="footer">

      <h6 align="left"> Your Career Direction, LLC •  96 Harvard Avenue, Maplewood, N.J. 07040 • (973) 996-0207 • lmark@yourcareerdirectionllc.com</h6>

    </div>

    <p> </p>

  <!-- end .footer --></div>

<!-- end .container --></div>

<script type="text/javascript">

var Accordion1 = new Spry.Widget.Accordion("Accordion1");

</script>

</body>

</html>

 
Replies
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 23, 2012 11:38 PM   in reply to Elynn C

    1. The spry accordian has a box around it on mouse down but I can't figure out how to get rid of it. I've checked all the CSS rules for the spry accordian and none of them seem to have rules around them.

     

    2. All the tabs have a content area underneath them and we only want content areas underneath the student tab. You see how it goes when you click on any of the tabs, you get a little thing that says content 1, 2 etc. I tried deleting them in the code and the page goes completely crazy when I do and the nav bar areas stretch all the way across the page.

     

    3. I can't figure out how to get the child tabs (which would be the tabs under students which say high school and college) to have two tabs. You will see that it does have the high school tab there now. When I try cutting and pasting the code to try to get two tabs, it does not work. The spry accordian framework only creates one content area under each tab.

     

    4. I'd like the child tabs to have a narrower height than the parent tabs, and be indented so that they will clearly be set off and different than the parent tabs.

    1. Line 454

    <div id="Accordion1" class="Accordion" tabindex="0" style="outline: none;">

    2 & 3. Change your code from Line 455 - 491:

     

    <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Home</a></div>

     

              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Students</a></div>

                <div class="AccordionPanelContent"><a href="#">High School</a><br/><a href="#" style="margin-top: -30px;">College</a></div>


              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Professional</a></div>

              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Parent/Educator</a></div>

     

              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Seminars</a></div>

     

              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Bio</a></div>

     

              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Q &amp; A Blog</a></div>

     

              </div>

              <div class="AccordionPanel">

                <div class="AccordionPanelTab"><a href="#">Testimonials</a></div>

     

              </div>

            </div>

          </li>

        </ul>

       
     
    </div>

    4. Append your HTML for child tabs like this:

    <div class="AccordionPanelContent" id="submenu"><a href="#">High School</a></div>

    Create a new #submenu css rule in your CSS document and set styling the way you want it.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points