Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...It's extraordinarily refreshing to see truly expert advice without having to wade through hipper than thou attitude..."

Geography

Where in the world do Tek-Tips members come from?

different styles attaching to spry menu..

rrmcguire (Programmer)
11 Apr 11 13:09
Hello,

I have the following HTML adding with 2 horizontal spry Menus within a Navigation Div then 2 container divs each with a spry menu with them. My first Spry Menu id=MenuBar1 class=MenuBarHorizontal is created correctly with the appropriate styles..

I then want to create separate styles for id=MenuBar2 class=MenuBarHorizontal.

How do I go about doing this...I tried duplicating the styles in my CSS styles panel then renaming them but it didn't do anything. Any help would be appreciated.


Here is my current script:

<div id="navigation">
  <div id="container2">
    <ul id="MenuBar2" class="MenuBarHorizontal">
      <li><a href="#">Item 1</a></li>
      <li><a href="#">Item 2</a></li>
      <li><a href="#">Item 3</a>
      <li><a href="#">Item 4</a></li></ul>
</div container2>
    <div id="container">
      <ul id="MenuBar1" class="MenuBarHorizontal">
        <li><a href="#">Home</a>
        </li>
        <li><a class="MenuBarItemSubmenu" href="#">Services</a>
          <ul>
            <li><a class="MenuBarItemHover" href="#">Flatbed</a></li>
            <li><a class="MenuBarItemHover" href="#">Van</a></li>
            <li><a class="MenuBarItemHover" href="#">Heavy Haul</a></li>
            <li><a class="MenuBarItemHover" href="#">Global</a></li>
            <li><a class="MenuBarItemHover" href="#">LTL</a></li>
            <li><a class="MenuBarItemHover" href="#">Cross Border</a></li>
          </ul>
        <li><a href="#">Customers</a>
        </li>
        <li><a href="#">Logistics</a></li>
        <li><a href="#">Agents</a></li>
        <li><a href="#">Contractors</a></li>
      <li><a href="#">Logistics</a></li></ul>
  </div container>
  
</div navigation>
Vragabond (Programmer)
12 Apr 11 1:03
We'd need to see the CSS, but it should be possible.  However, since Spry menu is done using javascript, it is possible that it applies certain styles on the fly.  Those won't be so easy to change.

As an aside, </div container> is an incorrect notation and can confuse browsers.

As a further aside, do we really need three separate threads to deal with your Spry menu?

Do something about world cancer today: Comprehensive cancer control information at PACT

rrmcguire (Programmer)
12 Apr 11 8:53
Sorry for the multiple threads. Got a little side-tracked and made changes since the beginning of some of the threads. Here is the CSS and I had read that you can change the styles to accomodate for a second spry menu. In my CSS below at the bottom I have what I believe should be written for my second menu to change one of the styles but nothing happens when I change any of the attributes of it

@charset "UTF-8";


/* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */

/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */

/*******************************************************************************

 LAYOUT INFORMATION: describes box model, positioning, z-order

 *******************************************************************************/

/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
{
    margin: 0;
    list-style-type: none;
    font-size: 100%;
    cursor: default;
    width: auto;
    padding-top: 0.9em;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 15.2em;
}

/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
{
    z-index: 1000;
}

/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
{
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 100%;
    position: relative;
    text-align: left;
    cursor: pointer;
    width: auto;
    float: left;
}
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
{
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 100%;
    z-index: 1020;
    cursor: default;
    width: 8.2em;
    position: absolute;
    left: -1000em;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
{
    left: auto;
}
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
{
    width: 8.2em;
    clear: left;
}
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
{
    position: absolute;
    margin: -5% 0 0 95%;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
{
    left: auto;
    top: 0;
}

/*******************************************************************************

 DESIGN INFORMATION: describes color scheme, borders, fonts

 *******************************************************************************/

/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
{
    border: 1px solid #CCC;
    width: auto;
}





ul.MenuBarHorizontal a
{
    display: block;
    cursor: pointer;
    background-color: #5A7E66;
    color: #FFF;
    text-decoration: none;
    text-align: center;
    height: 17px;
    padding-top: 9px;
    padding-right: 1em;
    padding-bottom: 9px;
    padding-left: 1em;
    font-family: Georgia, "Times New Roman", Times, serif;
}
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
{
    background-color: #33C;
    color: #FFF;
}
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
{
    background-color: #FFF;
    color: #5A7E66;
}

/*******************************************************************************

 SUBMENU INDICATION: styles if there is a submenu under a given menu item

 *******************************************************************************/

/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
{
    background-image: url(SpryMenuBarDown.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
}
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
{
    background-image: url(SpryMenuBarRight.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
{
    background-image: url(SpryMenuBarDownHover.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
{
    background-image: url(SpryMenuBarRightHover.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
}

/*******************************************************************************

 BROWSER HACKS: the hacks below should not be changed unless you are an expert

 *******************************************************************************/

/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
{
    position: absolute;
    z-index: 1010;
    filter:alpha(opacity:0.1);
}
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
{
    ul.MenuBarHorizontal li.MenuBarItemIE
    {
    display: inline;
    f\loat: left;
    background-color: #FFF;
    }
}



/****************************************************************************************




Second Spry Menu attributes





*****************************************************************************************/

ul.MenuBar2.MenuBarHorizontal
{
    margin: 0;
    list-style-type: none;
    font-size: 50%;
    cursor: default;
    width: auto;
    padding-top: 0.9em;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 15.2em;
}
        
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close