Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added notes and links to ref. in code #20

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions week1-dom/03_select_parent_child/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ function setup() {
noCanvas();

// Getting the element with the id banana with code
//see https://youtu.be/sSQPLIHIzmg?t=2m10s for a discussion of this
//using #unicorn as the select
//by creating the object (dom element) in js you have access to the object in js
// good reference
var p1 = select('#banana');

// Creating an element
//this will get called in the html
//reference https://p5js.org/reference/#/p5/createImage
var img = createImg('https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Bananas_white_background_DS.jpg/320px-Bananas_white_background_DS.jpg');

// Nesting the element inside the banana paragraph element
Expand Down