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 trialShariq Shaikh
13,945 PointsUsing hide("slow") instead of remove() as experiment does not run as smoothly as I would like, any suggestions?
I was playing around with the code for this project and wanted to see if I could make the button disappear slowly the way we made "its a trap appear, and although the button does disappear slowly it does so in a choppy manner, can anyone think of a way to make it disappear more smoothly?
1 Answer
Hugo Paz
15,622 PointsHere is a suggestion. Use fadeOut() to make the button transparent. When the animation ends, the button display is set to none so you dont have to remove it.
Shariq Shaikh
13,945 PointsWhen I tried that, the button shifted downward the same way it did at the beginning of the project before fading out
Hugo Paz
15,622 PointsI see what you mean. Now I am curious.
Hugo Paz
15,622 PointsOk i think i found a way, try this code on the hidespoilers projects.
$("button").click(function(){
//3.1, Get rid of button
$(this).fadeOut("slow", function(){
//3.2, Show spoiler next to the button clicked
$(this).prev().show();
});
});
Shariq Shaikh
13,945 PointsShariq Shaikh
13,945 PointsThe correct solution is in the last comment of the selected best answer