Skip navigation
Currently Being Moderated

SPRY Menu Internet Explorer display problem

Aug 17, 2011 4:07 AM

Can some please please please help me

 

my spry menu displays fine in Safari on mac but goes crazy in Internet explorer on a PC

 

The Links is....

 

www.andybarrington.com./ice/index.html

 

Im going insane trying to figure it out and getting nowhere

 

Im using dreamweaver cs4 to create this site on imac 10.6

 

 

All the best

 

Andy Barrington

 
Replies
  • Currently Being Moderated
    Aug 17, 2011 6:49 AM   in reply to Andrew Barrington

    Please copy and paste the following into a new document and view it in your browser

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/menubar/SpryMenuBarVertical.css" rel="stylesheet">
    <style>
    html {
         background: url(http://www.andybarrington.com./ice/images/background.png) repeat-x;
         font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
         height: 100%;
    }
    body {
         height: 100%;
         width: 800px;
         margin: 25px auto 0 auto;
         background: #FFF url(http://www.andybarrington.com./ice/images/Ice_roofing_logo.png) no-repeat left top;
    }
    #header {
         height: 200px;
         margin-bottom: 20px;
    }
    #aside {
         width: 171px;
         float: left;
    }
    #aside p {
         font-size: 10px;
         line-height: 15px;
    }
    h1 {
         color: #F90;
         height: 30px;
         text-transform: uppercase;
         font-size: 1em;
         letter-spacing: 0.3em;
         text-align: center;
    }
    #article {
         float: right;
         width: 628px;
         min-height: 405px;
         background: #CCC;
    }
    #article #section{
         float: right;
         width: 160px;
         min-height: 405px;
         background: #999;
    }
    #article #section h2 {
         text-transform: uppercase;
         text-align: center;
         font-size: 1em;
    }
    ul.MenuBarVertical {
         font-size: 80%;
         width: 171px;
         text-transform: uppercase;
         background: #E2E2E2;
    }
    ul.MenuBarVertical li {
         width: 171px;
    }
    ul.MenuBarVertical ul {
         width: 171px;
    }
    ul.MenuBarVertical ul li {
         width: 171px;
    }
    ul.MenuBarVertical a {
         padding: 0.75em 0.75em;
         color: #FFF;
         background: #FFF url(http://www.andybarrington.com./ice/images/button.png) repeat-x !important;
    }
    
    </style>
    </head>
    
    <body>
    <div id="header"></div>
    <div id="aside">
      <p>T: 01604 752 941<br>
        F: 01604 581 153 <br>
        E: <a href="mailto:enquiries@iceroofing.co.uk">enquiries@iceroofing.co.uk</a></p>
      <p>Unit 32, The Business Centre, Ross Road Northampton NN5 5AX </p>
      <ul id="MenuBar1" class="MenuBarVertical">
        <li><a href="#">About Us</a></li>
        <li><a href="#">Contact Details</a></li>
        <li><a href="#">Health & Safety</a></li>
        <li><a href="#">Environmental</a></li>
        <li><a href="#">Buily up Felt Roofing</a></li>
        <li><a href="#">Single Ply Roofing</a></li>
        <li><a class="MenuBarItemSubmenu" href="#">Structural Roofing</a>
          <ul>
            <li><a href="#">Item 3.1.1</a></li>
            <li><a href="#">Item 3.1.2</a></li>
          </ul>
        </li>
        <li><a href="#">Grren Roofs</a></li>
        <li><a href="#">Brown/Bio-Diverse</a></li>
        <li><a href="#">Specialist Services</a></li>
      </ul>
    </div>
    <h1>Industrial | Commercial | Environmantal</h1>
    <div id="article">
    
      <div id="section">
      <h2>LATEST NEWS</h2>
      </div>
    </div>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryMenuBar.js"></script>
    <script>
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>

     

    The have a good look at the markup and notice that there is no positioning used throughout the document. Also note the changed menubar.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 7:40 AM   in reply to Andrew Barrington

    it doesnt view correctly in safari

    I assume that you are referring to the white space underneath the menu button. That can be eliminated by adjusting the padding to 0.70em as in

     

    ul.MenuBarVertical a {
         padding: 0.70em 0.75em;
         color: #FFF;
         background: #FFF url(http://www.andybarrington.com./ice/images/button.png) repeat-x !important;
    }
    

     

    now and it has lost its actions on mouseover.

    That can be fixed with the following. Adjust the colour to suit.

     

    
    ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus {
         color: #999;
    }
    ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarVertical a.MenuBarSubmenuVisible {
         color: #999;
    }
    

     

    Also I need the menu to be identical to how i had it previously without any changes, and need it viewing correctly in all broswers (if possible).

    Please tell me in which way it differs from what you had and I shall fix it for you.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 8:19 AM   in reply to Andrew Barrington

    In my example, I purposely ignored your CSS files, using the original SpryMenuBarVertical.css and, in the document itself, my own style rules. The result can be seen here http://pleysier.com.au/andrew/

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 9:00 AM   in reply to Andrew Barrington

    Andy_Baz wrote:

     

    if its any help here are the links to my css and Spry files and

     

    http://www.andybarrington.com/ice/css/ice.css

     

    http://www.andybarrington.com/ice/SpryAssets/SpryMenuBarVertical.css

     

    I am natively creating the site on a mac using safari in which everything works fine, or at least it did until i started playing with the css settings 30 mins ago,

    my trouble is that it just does not view the same in IE on my windows PC that i use to test what sites look like in that browser

    Make a back up copy of your page.(just in case you need to go back)

     

    Remove the complete menu from the duplicated page that includes ALL the naviagtion items that you have in absolutely positioned <divs> (Most likely this is NOT helping you at all)

     

    Add this css to your main css file:


    #spryMenu {
        position:absolute;
        left:116px;
        top: 400px;
        width:171px;
        z-index: 100;
    }

     

    Copy the code below (scroll down) and paste it into your page right affter the closing </div> tag of your address:

     

    Ross Road Northampton NN5 5AX</p>
    </div>

     

    BELOW IS THE CODE YOU NEED TO COPY AND PASTE:

     

    <div id="spryMenu">
    <ul id="MenuBar1" class="MenuBarVertical">
    <li><a href="#">ABOUT US</a></li>
    <li><a href="#">CONTACT DETAILS</a></li>
    <li><a href="#">HEALTH &amp; SAFETY</a></li>
    <li><a href="#">ENVIRONMENTAL</a></li>
    <li><a href="#">BUILT UP FELT ROOFING</a></li>
    <li><a href="#">SINGLE PLY ROOFING</a></li>
    <li><a href="#">STRUCTURAL ROOFING</a>
    <ul>
    <li><a class="MenuBarItemSubmenu" href="#">COLD APPLIED LIQUID COATING</a></li>
    <li><a class="MenuBarItemSubmenu" href="#">BITUMINOUS HOT METAL WATERPROOFING</a></li>
    </ul>
    </li>
    <li><a href="#">GREEN ROOFS</a></li>
    <li><a href="#">BROWN BIO/DIVERSE</a></li>
    <li><a href="#">SPECIALIST SERVICE</a></li>

    </ul>
    </div>

     

     

     

    Below is the css for the SpryMenuBarVertical.css (copy it and save it into the SpryAssets folder in your site folder) remember to make a back-up of your original css file. Sometimes coding in the forum gets wrecked so if it doesn't work you will have to generally go through it and see where it differs from your css file.

     

     

     

    @charset "UTF-8";

     

    /* SpryMenuBarVertical.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, a fixed width box with no margin or padding */
    ul.MenuBarVertical
    {
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        cursor: default;
        width: 171px;
    }
    /* 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 same fixed width as parent */
    ul.MenuBarVertical li
    {
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        position: relative;
        text-align: left;
        cursor: pointer;
        width: 171px;
    }
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarVertical ul
    {
        margin: -5% 0 0 95%;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        position: absolute;
        z-index: 1020;
        cursor: default;
        width: 8.2em;
        left: -1000em;
        top: 0;
    }
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarVertical ul.MenuBarSubmenuVisible
    {
        left: 0;
    }
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarVertical ul li
    {
        width: 250px;
    }

     

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

     

    DESIGN INFORMATION: describes color scheme, borders, fonts

     

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

     

    /* Outermost menu container has borders on all sides */
    ul.MenuBarVertical
    {
        border: 1px solid #CCC;
    }
    /* Submenu containers have borders on all sides */
    ul.MenuBarVertical ul
    {
        border: 1px solid #CCC;
    }
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarVertical a
    {
        display: block;
        cursor: pointer;
        background-color: #EEE;
        padding: 0.5em 0.75em;
        color: #fff;
    font-size: 12px;
        text-decoration: none;
        background-image: url(../images/button.png);
        background-repeat: repeat-x;
    }
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus
    {
        background-image: url(../images/button2.png);
        color: #FFF;
    }
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarVertical a.MenuBarSubmenuVisible
    {
       
    }

     

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

     

    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.MenuBarVertical a.MenuBarItemSubmenu
    {

     

    }

     

    /* 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.MenuBarVertical a.MenuBarItemSubmenuHover
    {
       
    }

     

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

     

    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.MenuBarVertical 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.MenuBarVertical li.MenuBarItemIE
        {
            display: inline;
            f\loat: left;
            background: #FFF;
        }
    }

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 9:24 AM   in reply to Andrew Barrington

    Andy_Baz wrote:

     

    Thanks OSGOOD, really helpful indeed,

     

    except its not quite working, the vertical menu containing liquid coatings & bituminous etc, is not working when i hover over structural roofing nothing is happening.

     

     

    Thanks again

     

    Can you upload the page so I can take a look and see what has happened after you copied and pasted?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 10:15 AM   in reply to Andrew Barrington

    Andy_Baz wrote:

     

    http://www.andybarrington.com/ice/index.html

     

    uploaded for you now

     

    Some how in duplicating the page you have lost a couple of vital components

     

    1) The link to the 'SpryMenuBar.js' file in the SpryAssets folder. That can be inserted just before the link to the css (see below)

     

    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />

     

    2) The code below which can be inserted at the foot of the page just before closing </body> tag 

     

    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 12:15 PM   in reply to Ben Pleysier

    I have modified the page slightly, looks great. See here http://pleysier.com.au/andrew/

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 12:52 PM   in reply to Andrew Barrington

    I am getting too old for this. At this stage I am unsure whether you are having me on or not.

     

    The handy work that you are talking about is not mine. If you compare my markup to yours there is a vast difference, I would not have gone about it the way that you have done, it will come back to bite you. I must admit that I have spent a bit of time trying to help you; but this has disappeared into the mist.

     

    Good luck with your site.

    Gramps

     

    For others that are interested, I have pulled the site off air.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 11:40 PM   in reply to Ben Pleysier

    altruistic gramps wrote:

     

    I am getting too old for this. At this stage I am unsure whether you are having me on or not.

     

    The handy work that you are talking about is not mine. If you compare my markup to yours there is a vast difference, I would not have gone about it the way that you have done, it will come back to bite you. I must admit that I have spent a bit of time trying to help you; but this has disappeared into the mist.

     

    Good luck with your site.

    Gramps

     

    For others that are interested, I have pulled the site off air.

     

    Don't worry Gramps I have days like that too............many.

     

    I think sometimes we give more than is required. Yes, there is a great many occasions when the way the OP has set the site up is not the best BUT it's what they understand given their skill level and ability at the time. It's frustrating I know when you spend lots of time ironing out all the problems for them only to be ignored......been there and done that.

     

    Keep up the good work, your advice is an asset to the forum.

     

    Andrew will discover the errors of his ways in his own time..........we all did when we were first starting out. At that point Murray was my saviour way back 10 years or so ago.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 18, 2011 12:28 AM   in reply to Andrew Barrington

    In that case you may be interested in my interpretation of a cycling banner. The site http://pleysier.com.au/andrew/ is back on line.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 19, 2011 1:20 AM   in reply to Andrew Barrington

    Andy_Baz wrote:


     

    i need the site to now be centered in the window and not fixed, can you please help me

     

     

    This is where you're going to find life hard work because of using Absolutely Positioned <divs>. The first bit is simple:

     

    You need to wrap all of the code between the opening <body> tag and the closing </body> tag in a 'pageWrapper' <div>

     

    The opening tag of the 'pageWrapper' <div> goes in the location shown below, right after the opening <body> tag. Give it an 'id' of "pageWrapper" as shown.

     

    <body link="#ECECEC">


    <div id="pageWrapper">

     

    <div id="apDiv2">

     

     

    The closing tag for the 'pageWrapper'<div> goes directly before the opening <script> tag at the foot of the page.

     

    </div><!-- end pageWrapper -->


          <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    swfobject.registerObject("FlashID");
    //-->
          </script>

     

     

    Add the below css to your main style sheet:

     

    #pageWrapper {
    width: 800px;
    position: relative;
    margin: 0 auto;
    }

     

    That's the simple bit. NOW the absolutely positioned <divs> inside the 'pageWrapper' <div> take their top/left position from the top left of the 'pageWrapper' <div> - so you will have to adjust all the left positioning.

     

    The 'spryMenu' css for instance instead of left: 116px now needs to be left: 0px;

     

    #spryMenu {
        position:absolute;
        left: 0px;
        top: 380px;
        width:171px;
        z-index: 100;

    }

     

    Address panel apDiv will become left: 0px;

     

    #apDiv2 {
        position:absolute;
        left:0px;
        top:252px;
        width:171px;
        height:1px;
        z-index:0;
    }

     

    apDiv3 becomes left: 171px instead of 287px;

     

    <div id="apDiv3" style="position: absolute; left: 171px;

     

     

    You have to move each individual <div>, tedious. It's a learning curve -  setting up the page using better methods at the outset can save huge amounts of time.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 19, 2011 4:30 AM   in reply to Andrew Barrington

    If you have a look at my online example, you will find that it is centered. The way I have done this is

    body {
         height: 100%;
         width: 800px;
         margin: 25px auto 0 auto;
         background: #FFF url(http://www.andybarrington.com./ice/images/Ice_roofing_logo.png) no-repeat left top;
    }

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2013 7:32 AM   in reply to Andrew Barrington

    THE CONFLICT IS BETWEEN YOUR DOCUMENT CSS AND THE SPRY CSS.

     

    It is because the <li> and <a> TAGS have been styled and therefore OVERRIDDEN THE SPRY CSS.

     

    Use CLASS TAGS e.g.  <li class="anyclass"> and <a class="anyclass">
    and STOP USING THE <a> TAGS.

     


    N.b. you may need to unstyle any <a> or other TAGS that conflict with the SPRY CSS.  (However it's best to start over knowing that styling basic tags may affect the SPRY CSS).

     
    |
    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