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

David Jarrin
PLUS
David Jarrin
Courses Plus Student 11,182 Points

navcon image wont show up

ok so I am using js to have a navcon show up when the screen size is at mobile scale. Basically this with a flick function that contains a slide toggle.

$("#nav").addClass("js").before('<div id="menu"><img href="image/MobileMenuIcon.png" id="menuImage"></div>');

before I was using some unicode for the three bar image but I decided to use an image so it is sharper and I can manipulate its size easier. My CSS involving the navcon looks like so in my mobile.css

#menu {          /*is the mobile menu icon pops when screen is under a certain size*/

        display: block;

        font-size: 1.35em;
        padding: 20px 20px 20px 20px;

        float: left;

        position: fixed;
        top:  0;
        text-align: left;

    } 

    #menuImage {
        width: 100px;
        height: 100px;

}

All that shows up is a blank white box.

Any help would be greatly appreciated.

1 Answer

Any chance you meant for the href of the image to be:

href="images/MobileMenuIcon.png"  

As opposed to:

href="image/MobileMenuIcon.png"