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!

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

Hi everybody a little confused here ( not a code challenge issues), just need some help undertsnading where I went wrong

I just finished rewatching the Perform:Part 1 for lightbox. I am usind the workspace and I'm pretty sure that my code is the same as the video. Yet my results are different.

This is the link to the video: http://teamtreehouse.com/library/jquery-basics/creating-a-simple-lightbox/perform-part-1

This is my code:

$("#imageGallery a").click(function(event){
event.preventDefault();
var href = $(this).attr("href");
console.log(href);
});

Even though from what I can see in the video the code is the same. When I click the pictures they're still opening up which is the default. May someone point my mistake out to me. Thank you in advance!

3 Answers

Did you update your html and assign that id to your <ul>?

Is the console log statement working?

I did assign the id to the ul but I did forget to save it before I previewed it. Hmmm gotta remember the littel things. Thank you for your quick response. It is working now.

You're welcome. Glad you figured it out.

I have the same problem. Wondering if something is overriding it?

In this case the file hadn't been saved yet. You should post a new discussion with the details of your problem.