M
M
maximusDreddoff2015-10-27 15:48:05
JavaScript
maximusDreddoff, 2015-10-27 15:48:05

Change images on click of a button?

It is necessary to make it so that when the button is clicked, the images in the second block with the picture change. Wrote the code, but it doesn't work at all. I can't figure out what's wrong. I attach the code:

jsfiddle.net/4Lzypuze/2

thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2015-10-27
@maximusDreddoff

You were pinched by the closure of the campaign. When the handler is called, the i variable is used internally, which does not exist in the global scope on the
UPD page. Just include jquery. jsfiddle.net/4Lzypuze/3 This is how something comes to life

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question