Results 1 to 4 of 4

Thread: can't get CSS gradients to work in IE7

  1. #1
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default can't get CSS gradients to work in IE7

    1) Script Title: jQuery Multi Level CSS Menu #2

    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...el_css_menu_2/

    3) Describe problem:

    Hi everyone,

    I've been using this Multi Level Menu for a while and it's worked great, but when I tried to update the look a bit w/ a gradient, I'm getting major problems in IE, especially IE7.

    Code:
    /* for Mozilla */
    background-image: -moz-linear-gradient(0% 70% 90deg, #687d96, #95b3d7 70%);
    /* for IE6, IE7 */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#95b3d7, endColorstr=#687d96); 
    /* for IE8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#95b3d7, endColorstr=#687d96)"; 
    /* for WebKit (Safari, Chrome, etc) */
    background-image: -webkit-gradient(linear, 0% 70%, 0% 45%, from(#95b3d7), to(#687d96));
    Could someone tell me what I'm doing wrong here? When I add this code to .jqueryslidemenu and .jqueryslidemenu ul li a of jqueryslidemenu.css, it works perfectly in FF, but the main tabs don't give the gradient color in IE7 and it causes a bug in the drop down menu as well where some random lines appear when you scroll across the menu.

    Any ideas are appreciated. Thanks!

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I'm not too up on gradients but I believe that 'hasLayout' needs to be set to satisfy gradient requirements in IE. Adding 'zoom:1;' to your IE6/7 stylesheet for the gradient element should fix the problem without the need for setting positions and dimensions in your CSS.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi Beverley,

    Thanks for the input! I'm definitely a CSS rookie as I'm just hearing of 'hasLayout' for the first time.

    This is the little piece of code that goes on every page with the menu:
    Code:
    <link rel="stylesheet" type="text/css" href="jqueryslidemenu.css" />
    
    <!--[if lte IE 7]>
    <style type="text/css">
    html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/
    </style>
    <![endif]-->
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
    <script type="text/javascript" src="jqueryslidemenu.js"></script>
    I've just spent some unsuccessful time with google, but would the zoom:1; be able to go here at all? I tried sticking it after the height: 1% but that didn't work.

  4. #4
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Actually I just stuck zoom: 1; into jqueryslidemenu.css twice under the gradient images for IE7.

    Code:
     /* for IE6, IE7 */
     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B1D1F1, endColorstr=#687D96);
    zoom: 1;
    It's not pretty, but it seems to work. Thanks again for the help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •