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
Frank Cameron-Wilson
8,814 Pointsusing jquery in codepen
Hi all,
I've just done a little project that has some jquery code, and i'm sure that the code could be improved on.
I've tried putting the code example on codepen:
codepen
but the jquery isn't working.
I've uploaded the full site to a subdirectory on my server just to check it worked:
Live site
and all is working fine, view in chrome for best results.
So why isn't the same code working in codepen??
Any help would be appreciated.
Thank you in advance.
Frank
4 Answers
James Barnett
39,199 PointsIn codepen, click on the gear in the JS section
Matt Campbell
9,767 PointsYou've got to turn jQuery on. One of the button on the javascript panel on codepen.
Frank Cameron-Wilson
8,814 PointsI've selected jquery from the library list and have auto run checked. When i click on the Analyze JS button. i have a missing semicolon message on this bit of code Which is nested inside a click function.
I've tried adding a ; after the last } but then it tells me there are 1 missing + 1 unexpected.
if(document.getElementById("home").hasAttribute("style")) {
$("#home").css( {"-webkit-animation":"sliderOut 3s linear"} );
setTimeout(function() {$("#home").removeAttr("style")}, 3500);}
Frank Cameron-Wilson
8,814 PointsI'm just not getting how it can work live, but not in codepen???
Jay Holt
15,617 PointsI having the same problem. I have read a few things that say if you write your code in-line in the HTML doc, it will work. Trying this out now. But it would be nice to have a fix without doing that.

Frank Cameron-Wilson
8,814 PointsFrank Cameron-Wilson
8,814 PointsCheers James, That's all done. and still getting the problem mentioned above.