GithubHelp home page GithubHelp logo

tutsplus / javascript-for-web-designers Goto Github PK

View Code? Open in Web Editor NEW
30.0 5.0 34.0 6.54 MB

Source files to accompany Tuts+ course: JavaScript for Web Designers

License: BSD 2-Clause "Simplified" License

HTML 50.69% CSS 21.47% JavaScript 27.84%

javascript-for-web-designers's Introduction

Envato Tuts+ Course: JavaScript for Web Designers

Instructor: Adi Purdila

In this course you’re going to learn the basics of JavaScript and see some examples that are more geared towards what a web designer might face on a daily basis.

Source Files Description:

The source files contain the examples presented in the course videos. Use them to double-check your code or work alongside the instructor.

Available on Envato Tuts+ from December, 2016

javascript-for-web-designers's People

Contributors

snaptin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

javascript-for-web-designers's Issues

Back to top JS no longer works

Tried following along with the tutorial (on youtube) and the btt.addEventListener() click function for the back to top demo doesn't work in Chrome or safari. Tried downloading straight from github and the same result. What's changed 3 years?

keyCode is deprecated. Use .key instead

I noticed that .keyCode has a line through it in my vscode saying its deprecated. We no longer need to use keyCode. Instead we now use .key and just put the name of the key in quotations that we are trying to target, as stated by this stackoverflow thread: https://stackoverflow.com/questions/35394937/keyboardevent-keycode-deprecated-what-does-this-mean-in-practice

Ive changed some of the code in the autocomplete project. Feel free to use it in your code.

if (results.classList.contains("visible")) {
switch (
event.key //used to be event.keyCode. New syntax is event.key
) {
case "Enter": // used to be case 13. now updated to the new .key syntax
targetInput.value = results.children[resultsCursor].innerHTML;
toggleResults("hide");
resultsCursor = 0;
break;
case "Arrow up":
if (resultsCursor > 0) {
resultsCursor--;
moveCursor(resultsCursor);
}
break;
case "Arrow down":
if (resultsCursor < matches.length - 1) {
resultsCursor++;
moveCursor(resultsCursor);
}
break;
}
}
});

// Add event listener for the input keydown
targetInput.addEventListener("keydown", function (event) {
if (event.key == "Enter") { //used to be event.keyCode == "13"
event.preventDefault(); //prevents page from refreshing upon hitting enter
}
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.