Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

different styles attaching to spry menu..

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
US
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>
 
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?

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
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: */
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;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top