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
troy beckett
12,035 Pointswhen i click right arrow of lightbox highlight appears below image???
Here is a link to a page on my website below:
http://top-drawer.net/artist-1.html
On the page your see some thumbnails with a bigger image next to them. Click the bigger picture and it will reveal a lightbox.
Now my problem is this. When I click the right arrow button on my lightbox to cycle to the next image a highlight appears below the image. Press quite quickly to see what I mean. Whats confusing me about the problem is that the left arrow has no problems at all and uses the same code. I'm using google chrome to view my work.
1 Answer
Sidney Casagrande
7,035 PointsI think the main problem you are facing is that you dynamically fix the height of the image which falls through to the container (lightbox). I would recommend to ensure the container (lightbox) fills the whole visible page, no matter it's content. I also personally would not dynamically calculate any image sizes, but instead maybe attach a class which has some image size rules in CSS attached. In the end all the showImage function should do is to pop up that lightbox with the selected image displayed. Any positioning and scaling should not be handled in jQuery but in CSS instead (one other key benefit of that is performance improvements). I hope this helps.