Return to Video

Collecting Click Locations Solution - JavaScript Basics

  • 0:00 - 0:04
    Okay, so here's the shell of the code that we saw before, where we're
  • 0:04 - 0:09
    grabbing the click location on the document, which is just the whole website.
  • 0:09 - 0:13
    And we're going to be running some steps, using this weird function syntax,
  • 0:13 - 0:15
    that we'll actually be learning a little bit more about soon.
  • 0:15 - 0:19
    Every time the page is clicked, we create two new variables, x and y.
  • 0:19 - 0:22
    Both of them use this location object,
  • 0:22 - 0:26
    this location event object from the click, and we grab its pageX and its pageY,
  • 0:26 - 0:30
    which are simply the pixel values of the x and y location of the clicks.
  • 0:30 - 0:35
    Once we have the x and y locations, we simply pass them into logClicks and
  • 0:35 - 0:40
    we should see, when we click, there it is again, x and y locations.
タイトル:
Collecting Click Locations Solution - JavaScript Basics
概説:

more » « less
Video Language:
English
Team:
Udacity
プロジェクト:
ud804 - Javascript Basics
Duration:
0:41

English subtitles

改訂 Compare revisions