SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru XraySierra's Avatar
    Join Date
    Jan 2002
    Location
    Ontario, Canada
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation IE Dropdown Problem in IE7 and 8

    One of my sites (Outdoor Living) has a simple dropdown menu that buts a little <em> tag after the menu item. The text in this <em> tag is suppose to be small and italic.

    It works in all browsers, and IE 9, but the text appears the same size as the menu item in IE 7 and 8. Any thoughts?

    How it's suppose to look:


    How it looks in IE7 and IE8:
    Chris Blackwell - my blog and ramblings
    Comicville - Daily News and Comic Reviews

    "web development is what I love...so that's what I do"


  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,281
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I think it's a javascript problem as IE isn't recognising that there is an em in place. I assume you are grabbing the title text and appending it in em.

    If I reproduce the page with the em added normally then it works as expected.

    The developer tools in IE show the text you added as an empty text node (screenshot attached).

    Do you want this moved to the javascript forum?
    Attached Images Attached Images

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,281
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Ok, I found the error and you have a semi colon in the append routine ( .attr('title'); ) that shouldn't be there (outdoor.js).

    It should be like this:
    Code:
    $(document).ready(function(){
        
        // Activate Lightbox
        $('.lightbox').lightbox();
        
        // Store sub-menu title attr and append to link 
        $("#top nav ul ul li a").append(function(){
          return '<em>' + $(this).attr('title') + '</em>';
        });
        
    });


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
  •