Skip to content

Instantly share code, notes, and snippets.

@laurenhavertz
Last active December 19, 2015 06:29
Show Gist options
  • Save laurenhavertz/5911737 to your computer and use it in GitHub Desktop.
Save laurenhavertz/5911737 to your computer and use it in GitHub Desktop.
WDI Action Adventure

How to start

  • deconstruct a program and turn it into steps-comment out in the editor
  • start with the most simple step
  • test small things in the console to reaffirm basic assumptions (do my expectations meet my results?)
  • DIVIDE AND CONQUER

##jQuery

  • div divides blocks
  • span divides in-line text
  • grabs something on the page and can see the value

look up jQuery event documentation

$('input').val('') # sets value

var message = $('input').val() # gets value
declare variables, insert functions, run code

####Event Oriented "For Loop" function rotateImage() { $('img.js-pic').attr('src', pics[i]); i += 1; if (i === pics.length) { i = 0; } }

Reference 'jsFiddle photo'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment