GithubHelp home page GithubHelp logo

silliecelia / 2019-spring-06-javascript-functions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coderbabez/2019-spring-06-javascript-functions

0.0 2.0 0.0 970 KB

HTML 21.24% JavaScript 57.19% CSS 21.57%

2019-spring-06-javascript-functions's Introduction

CoderBabez

Week Six - More Javascript

Objectives

Update the Puppy Fun House page to responds to more event handlers and selectors.

Vocab

  • Javascript event handler
  • JQuery
  • Functions

Review

  • What do we use JavaScript for?
  • How do we connect JavaScript to our html?
  • What is an event handler?

Lesson

Take a look at the live site:

  • What are the html elements?
  • What changes when the button is clicked?

Take a look at the html:

  • What's in the html?
  • How is the content initialized?
  • How is the content changed when the button is clicked?
What are functions?

Functions are reusable sections of code. They are given 0, 1, or many parameters and operate on the page.

Functions look like:

function functionName(parameter) {
  // code
}

Functions are called like:

 functionName(value);

Don't worry too much about them now. Just know that you can call existing functions.

Find the functions in this project. Look in all the JavaScript files!

Homework: Update this project

  • Add a second button in the header that changes the body color of the page.

    • What function would you call to get a new color?
    • Align it to the right side of the page
  • Add a 4th column

    • Have it update when the other 3 columns are updated
    • How are the columns being selected
    • How will the width of the columns change?
    • Can you create a new function that will update all 4 columns in 1 call?
  • Update functions

    • Add 2 more dogs to the randomDog function
    • Add 2 more colors to the randomBodyColor function
  • Publish your page on github (gh-pages!)

Reference:

2019-spring-06-javascript-functions's People

Contributors

becsegal avatar megknoll avatar

Watchers

 avatar  avatar

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.