tilbage til lektionen
Dette materiale er kun tilgængeligt på følgende sprog: English, Español, Français, Italiano, 日本語, 한국어, Русский, Українська, Oʻzbek, 简体中文. Hjælp os med at oversætte til Dansk.

Image gallery

vigtighed: 5

Create an image gallery where the main image changes by the click on a thumbnail.

Like this:

P.S. Use event delegation.

Åbn en sandbox til opgaven.

The solution is to assign the handler to the container and track clicks. If a click is on the <a> link, then change src of #largeImg to the href of the thumbnail.

Åbn løsningen i en sandbox.