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.

Jana Ryndin
7,161 PointsWhy the screen does not turn black?
jQuery
var $overlay = $('<div id="overlay"></div'>);
$("body").append($overlay);
$("#imageGallery a").click(function(event){
event.preventDefault();
var href = $(this).attr("href");
$overlay.show();
CSS
#overlay {
background:black;
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
}
4 Answers

Kevin Korte
28,109 PointsIn addition to Sean Do's suggestion, you also did not close your click function at the end of the JS file. })
You're missing that.
Make those two correction, and you can verify your code works.

Sean Do
11,933 Pointsvar $overlay = $('<div id="overlay"></div'>);
The single quote is inside the div end tag.

Jana Ryndin
7,161 PointsThank you so much. After I posted I found it too. Wanted to let people know here but you were quicker. This was it, it works!

Jana Ryndin
7,161 PointsI closed the click function but forgot to include it here in the post. Thanks.