Toggling the panel - transfered the code outside codeacademy - does not work


#1

I have recreated the 3 separate files by copying their content: index.html, stylesheet.css and script.js for the exercise that toggles the slide up/down panel. In index.html the only addition made was to add a jQuery CDN / tried even with a link to the downloaded jQuery.

The toggle does not work outside code academy. When I click on the 'pull-me' div nothing happens.

Does anyone have any idea why?

Thank you!


#2

if you did everything right, it should work. The only way we can verify is if you share the files. Maybe make a github repository and share the link?


#3

Sure, here is the github link where I posted the files https://github.com/Ava-O/codeAcademy


#4

if the 3 files are in the same directory, all should be good


#5

Actually, it is not working if the link to the script.js file is put before the one for jQuery.

Regardless, Code Academy should consider adding a link to jQuery in the tutorial. The code is incomplete as it is just because a small but important part is missing and it could be misleading to many.

Thanks for having looked and for the fast replies! If possible, pls make a note on this to the tutorial creators/editors.


#6

The reason script.js doesn't work if linked before the jQuery script link is because since script.js is jQuery, it need the jQuery code to be loaded first so that the computer understands script.js...


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.