
Time to dive into JavaScript to add some interactivity to our website! It's a relatively simple bit of JS that we're adding, so I take advantage to take a quick look at how to write an arrow function when compared to the more traditional way of writing functions. Some of the JS stuff that I look at are accessing things using querySelector, as well as adding and toggling classes with classList.add and classList.toggle If you'd like some more info on JavaScript arrow functions (and ES6 in general), this is a nice place to start: https://zellwk.com/blog/es6/ Some people might blow a fuse because I don't use semi-colons in my JS, but here is what convinced me not to bother with them: https://feross.org/never-use-semicolons/ Also, since I am using ES6 in this, you might want to use Babel: https://babeljs.io/ if you're going to use this on a real project And of course, if you've got any comments, questions or anything else, please leave a comment! Also, let me know if I said I'd include something in here during the video, and I managed to once again forget! Also, I made a BIG mistake at the end of this video, when I didn't notice the side-scrolling that was introduced. You can get rid of it by adding overflow-x: hidden; on the body. Sorry about that! --- New to Sass, or want to step up your game with it? I've got a course just for you: https://www.kevinpowell.co/learn-sass --- My Code Editor: VS Code - https://code.visualstudio.com/ How my browser refreshes when I save: https://youtu.be/h24noHYsuGc --- Support me on Patreon: https://www.patreon.com/kevinpowell I'm on some other places on the internet too! If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter. Instagram: https://www.instagram.com/kevinpowell... Twitter: https://twitter.com/KevinJPowell Codepen: https://codepen.io/kevinpowell/ Github: https://github.com/kevin-powell
How to code a slide out navigation | Part 2: The JavaScript - YouTube |
135 Likes | 135 Dislikes |
5,411 views views | 75,677 followers |
Cars & Vehicles | Upload TimePublished on 8 Nov 2017 |
Không có nhận xét nào:
Đăng nhận xét