Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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"