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

CSS jQuery Basics (2014) Creating a Spoiler Revealer Plan

Corey Standish
Corey Standish
14,835 Points

Why button only covers half of the spoiler

When I refresh, the button does not hide all of the spoiler. It looks like the button graphic isn't big enough to cover the spoiler.

Sounds like your not properly hiding the spoiler once the dom is loaded. The button isn't actually overlaying the spoiler but actually the spoiler is initially set to be hidden and only the button is visible when you then click on the button the button has a click handler to show the spoiler in which case in this video now you have both elements still visible and I'm assuming in the next video your going to show the spoiler and hide the button in the on click now

hope that helps, shouldn't have to edit any css, the elements weren't positioned on on top of each other

2 Answers

Go into the CSS file and find the code you wrote for the button element. Try re-sizing it. Checking my old project, the width of the button element is 480 px, and that covers the spoiler entirely.

If that doesn't fix it, post your code. IT'll make it easier for forum members to find the problem and help you out.

Josh Curtis
Josh Curtis
7,782 Points

Hi Corey, did you figure this out? I had the same issue and then realized that I missed the "." before the spoiler. The correct code for the hide spoiler section is $(".spoiler span").hide();