There are a lot of techniques, very many examples. Just learn slowly, practice slowly!! Now this book is "javascript combat----javascript,JQu ery,HTML5, N ode.js instance full "
JavaScript, JQuery, HTML5, node. js instances Daquan-Reading notes 2
3.3 Responding to mouse actions
The effect of Figure 3-2 is already there, and you need to manipulate the mouse to show the photos you want to see. This requires adding events to the corresponding place.
3.3.1 Response Small Photo click action
A Eg.showthumb () method showing a list of small graphs is provided in the 3.2.3 code. You want to display a large picture when you click a small picture. This requires calling the Eg.showbig () method, which only responds to the Click event when the small picture is clicked, so it needs to be implemented with the Eg.addlistener () method, and the detailed code is shown in "Example 3-4".
"Example 3-4 response Small Photo click action"
The 9th line in "Example 3-4" is the code that responds to a small photo click action, where a closure is used. That is, a self-invoking anonymous function.
(function () {}) () is the simplest closure.
The contents of the curly braces run sequentially. Assuming you get rid of lines 9th and 14th, you'll find that the last 1 in the current group photo is always displayed. In the body of the For statement, the value of the variable is generally passed to the internal binding event.
most soldiers attack the actual type of JavaScript
JavaScript, JQuery, HTML5, node. js instances Daquan-Reading notes 3