Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Smells Like Bakin' project complete with wmu slider not working on IE8

Hi there,

I have just completed the 'Build an Interactive Website' project for the 'Smells Like Bakin'' Company, and when I tested it on IE10 and Chrome it worked like a charm. I was busy showing it to everyone, and then when I switched it over to IE8, the WMU Slider - and the accompanying text and image - suddenly disappeared! I also had issues with the grid layout (it seemed to collapse!).

Is there standard wording (to put somewhere in the html) to resolve issues connected with ie 7/8/9? I have currently build another site, based on the Jquery tutorial, which seemed to work amazing well in ie10, but I started experiencing background image issues in ie8. (http://academy.young1.org).

IE8 is still relatively popular over here (UK), so I am keen to solve these cross-browser compatibility issues!

Here is some of my code from Smells Like Bakin':

<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Smells Like Bakin' Cupcake Company</title> <link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen"> <link rel="stylesheet" href="css/grid.css" type="text/css" media="screen"> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"> <link href='http://fonts.googleapis.com/css?family=Nunito:400,300,700' rel='stylesheet' type='text/css'> <meta name="viewport" content="width=device-width, initial-scale = 1.0"> <style tupe="text/css">

/* mwuSlider */
.wmuSlider {
    position: relative;
    overflow: hidden;
    height: 310px;

}
.wmuSlider .wmuSliderWrapper {

}
.wmuSlider .wmuSliderWrapper article {
    position: relative;
    height: 310px;


}
.wmuSliderPagination {
    z-index: 2;
    position: absolute;
    left: 20px;
    bottom: 10px;
}
.wmuSliderPagination li {
    float: left;
    margin: 0 5px 0 0;
    list-style-type: none;
}
.wmuSliderPagination a {
    display: block;
    text-indent: -9999px;
    width: 10px;
    height: 10px;
    background: #4FB69F;
    border-radius: 5px;
    -webkiet-border-radius: 5px;
    position: relative;
    left: 480px;

}
.wmuSliderPagination a.wmuActive {
    background: #349C79;
}

@media screen and (max-width: 650px) { .wmuSlider { display:none; } } </style> </head>

<body>

<div class="container clearfix">
    <div id="logo" class="grid_4">

        <object data="img/logo.svg" type="image/svg+xml" class="logo">
            <!--[if lte IE 8 ]-->
            <img src="img/logo.gif" alt="Smells Like Bakin">
            <!--![endif]-->
        </object>

    </div>
    <div id="nav" class="grid_8 omega">
        <ul>
            <li class="about"><a href="#">About</a></li>
            <li class="pricing"><a href="#">Cupcakes & Prices</a></li>
            <li class="locations"><a href="#">Locations</a></li>
            <li class="contact"><a href="#">Contact Us</a></li>
        </ul>
    </div>

    <!-- Intro Images -->

    <div id="intro-slider" class="wmuSlider grid_12 omega">
        <div class="wmuSliderWrapper">

            <article id="intro-cupcakes" class="grid_12 omega">

                <div class="intro grid_9">
                    <h1 class="fittext">Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious desserts. </h1>
                    <p><a href="pricing.html" class="btn">Browse Our Cupcakes</a></p>
                </div>

                <div class="intro-img grid_3 omega">
                    <object data="img/you-bake-me-blush.svg" type="image/svg+xml">
                        <a href="you-bake-me-blush.svg">
                            <!--[if lte IE 8 ]-->
                            <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">
                            <!--![endif]-->
                        </a>
                    </object>
                </div>
            </article>


            <article id="intro-locations" class="grid_12 omega">

                <div class="intro grid_8">
                    <h1 class="fittext">We're kicking taste buds in to high gear from the west to the east coast with our featured avacodo chocolate cupcake.</h1>
                    <p><a href="locations.html" class="btn">View Our Locations</a></p>
                </div>

                <div class="intro-img grid_4 omega">
                    <object data="img/love-at-first-bite.svg" type="image/svg+xml">
                        <a href="love-at-first-bite.svg">
                            <!--[if lte IE 8 ]-->
                            <img src="img/love-at-first-bite.gif" alt="Love at First Bite">
                            <!--![endif]-->
                        </a>
                    </object>
                </div>
            </article>
        </div>
    </div>

    <!-- End Intro Images -->
    <div id="featured-cupcake" class="grid_7">
        <h2>Cupcake of the Week</h2>
        <p>This week’s featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. It’s flavors will kick your taste buds into fiesta mode!</p>

        <div id="featured-video">
            <iframe src="http://player.vimeo.com/video/50610288?title=0&amp;byline=0&amp;portrait=0" width="400" height="275" frameborder="0"></iframe>
        </div>

    </div>

    <div id="new-cupcakes" class="grid_5 omega">
        <h2>Fresh Out the Oven</h2>
        <p>Our newest cupcakes are <a href="#">Bacon Me Crazy</a> and <a href="#">Jalapeño So Spicy</a>. </p>

        <div data-picture data-alt="Bacon Me Crazy">
            <div data-src="external/imgs/bacon-small.jpg"></div>
            <div data-src="external/imgs/bacon-medium.jpg"     data-media="(min-width: 400px)"></div>
            <div data-src="external/imgs/bacon-large.jpg"      data-media="(min-width: 800px)"></div>
            <div data-src="external/imgs/bacon-extralarge.jpg" data-media="(min-width: 1000px)"></div>
            <!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
            <noscript>
                <img src="external/imgs/bacon-small.jpg" alt="Bacon Me Crazy">
            </noscript>
        </div>


        <div data-picture data-alt="Spicy Lime">
            <div data-src="external/imgs/lime-small.jpg"></div>
            <div data-src="external/imgs/lime-medium.jpg"     data-media="(min-width: 400px)"></div>
            <div data-src="external/imgs/lime-large.jpg"      data-media="(min-width: 800px)"></div>
            <div data-src="external/imgs/lime-extralarge.jpg" data-media="(min-width: 1000px)"></div>
            <!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
            <noscript>
                <img src="external/imgs/lime-small.jpg" alt="Spicy Lime">
            </noscript>
        </div>

    </div>

    <div id="about" class="grid_7">
        <h2>Inside the Kitchen</h2>
        <p>Smells Like Bakin’ started out in the garage of the husband wife duo Allison &amp; Joseph. Allison is the baker, and Joseph found a way for them to make a business out of her tasty treats. Flash forward to today and they have a successful store front, catering business and cupcake truck. </p>
        <p><a href="#" class="btn-small">Read More</a></p>
    </div>


    <div class="grid_5 omega">
        <h2>Get Bakin’ with Us</h2>

        <div id="contact">
            <p>Call us: <span>1-800-CUP-CAKE</span><br>
                Email us: <a href="#">bakeon@smellslikebakin.com</a></p>
            </div>

            <p>We announce all of our new flavors first through Facebook &amp; Twitter, and even take requests!</p>     

            <object data="img/facebook.svg" type="image/svg+xml">
                <a href="facebook.svg">
                    <!--[if lte IE 8 ]-->
                    <img src="img/facebook.gif" alt="Facebook">
                    <!--![endif]-->
                </a>
            </object>

            <object data="img/twitter.svg" type="image/svg+xml">
                <!--[if lte IE 8 ]-->
                <img src="img/twitter.gif" alt="Twitter">
                <!--![endif]-->
            </object>
        </div>

        <div id="copyright" class="grid_12">
            <p>© 2012 Smells Like Bakin' Cupcake Company. All Rights Reserved.</p>
        </div>

    </div>

    <script src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.wmuSlider.min.js"></script>
    <script src="external/matchmedia.js"></script>
    <script src="picturefill.js"></script>

    <script src="jquery.fitvids.js"></script>
    <script src="jquery.fittext.js"></script>

    <script>
      // Target your .container, .wrapper, .post, etc.
      $("#featured-video").fitVids();
      setTimeout(function(){
        $(".fittext").fitText(2.2);
      }, 1);



      var options = {navigationControl: false, animation:"fade"}
      $(".wmuSlider").wmuSlider(options);
      </script>

      <script type="text/javascript" src="js/jqury.js"></script>
      <script type="text/javascript">
      $("#form span").hide();
      </script>
  </body>
  </html>

Thanks!

Regards,

Robert.

Matthew McCulloch
Matthew McCulloch
5,341 Points

First thing I'd try is to add Modernizr script to the page. You can grab the full or a custom version at: http://modernizr.com/

IE8 does not recognize the article tag, and the slider uses the article tag for it's elements. Hopefully Modernizr will rectify that by adding article to the DOM and it might magically fix it.

If that doesn't work you can dive into the WMUSlider code and change it to target a div with a particular class maybe? As opposed to the article tag.

3 Answers

Matthew is spot on stick Modernizer in there and it will sort you right out - as HTML5 structural tags are not supported my raw IE8

G

Thanks guys - yes that solves the WMU Slider problem...I think it's just a CSS issue now, on my site (the academy one I mentioned), and also on the Smells Like Bakin' site, some of the layout seems to have been altered and the background images are not appearing. Funnily enough it works if you select 'ie8 Document Mode: Standards' rather than the default one it switches to which is 'ie8 Document Mode: ie5 Quirks'.

Matthew McCulloch
Matthew McCulloch
5,341 Points

Do you have a doctype defined at the head of the page? It seemed weird that IE8 would downgrade to quirks mode by default so I did some research and it appears it does that if there isn't a doctype defined.

<!DOCTYPE html>

If that doesn't work you can try and force standards mode with this meta tag

<meta http-equiv="X-UA-Compatible" content="IE=Edge">

That will tell IE to use the latest standards mode that it's capable of. If it's downgrading to IE5 mode that will probably invalidate 90% of the CSS out there as that was before CSS2 or CSS3 I believe.