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 trialbarnetobeka
Courses Plus Student 10,895 PointsOverlay
I need help ! the over lay darkens though i included the rgba()
:
var $overlay ='<div id="overlay"></div>';
var $image=$('<img>');
$overlay.append(image);
$('body').append($overlay);
$('#imagegallery a').click(function(event){
event.preventDefault();
var $gallery =$(this).attr("href");
$image.attr("src",$gallery);
$overlay.show();
});
$overlay.click(function(){
$overlay.hide();
});
1 Answer
Arturo Perez
Front End Web Development Techdegree Student 12,902 PointsI can see one mistake. this code should be like this $overlay.append($image);
and not like this $overlay.append(image);
.
seems like your just missing the $
.