Starting to drag


show more Starting to drag provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Events show less
please wait ...

Starting to drag

Its time to start working on the JavaScript and I am going to go ahead and delete this extra space for here from the body and just save this. We don't really need to do anything else with the Index HTML document and we're done also with the style.css. The only thing we need to work with is the script.js file, now what I'm going to do is put my functions into a self executing variable, this is called namespacing. And its a pattern popularized by Yahoo and essentially it works like this. You create a new variable. I'm going to call mine dragndrop and we set that to a function inside some parenthesis.

(BLANK_AUDIO) And after that we add another parenthesis and a semicolon. And then we're going to put all of our code right here in inside this variable. The reason I'm going to do this is because I'm going to be using a couple of global variables. And this technique is going to protect any other script I might have in my HTML document from having an issue with any of my global var...

Starting to drag
Video duration: 6m 44s 2h 11m Intermediate

Viewers:

Starting to drag provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Events

Subjects:
Developer Web
Software:
JavaScript
Author:
please wait ...