You need to make a gallery so that the image is loaded when you click on the thumbnail:
How are these galleries made? Perhaps there are ready-made plugins?
You need to make a gallery so that the image is loaded when you click on the thumbnail:
How are these galleries made? Perhaps there are ready-made plugins?
For your implementation of such a slider there is a wonderful plugin - Fotorama . It allows you to make and thumbnails, and paging on svaypu on mobile devices, and the download indicator is:
<!-- 1. Link to jQuery (1.8 or later), --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- 33 KB --> <!-- fotorama.css & fotorama.js. --> <link href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet"> <!-- 3 KB --> <script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script> <!-- 16 KB --> <!-- 2. Add images to <div class="fotorama"></div>. --> <div class="fotorama" data-nav="thumbs"> <img src="http://s.fotorama.io/1.jpg"> <img src="http://s.fotorama.io/2.jpg"> </div> If desired, the animation, if you do not need it in this case, you can turn off or change:
<!-- 1. Link to jQuery (1.8 or later), --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- 33 KB --> <!-- fotorama.css & fotorama.js. --> <link href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet"> <!-- 3 KB --> <script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script> <!-- 16 KB --> <!-- 2. Add images to <div class="fotorama"></div>. --> <div class="fotorama" data-nav="thumbs" data-transition="slide" data-clicktransition="crossfade"> <img src="http://s.fotorama.io/1.jpg"> <img src="http://s.fotorama.io/2.jpg"> </div> //ΡΠΎΠ·Π΄Π°Π΅ΠΌ ΠΎΠ±ΡΠ°Π±ΠΎΡΡΠΈΠΊ ΡΠΎΠ±ΡΡΠΈΡ Π½Π° ΠΊΠ»ΠΈΠΊΠ΅ ΠΏΠΎ ΠΌΠΈΠ½ΠΈΠ°ΡΡΡΠ΅: $('#gallery img').click(function(){ //ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ Π°Π΄ΡΠ΅Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ ΠΈΠ· Π΄Π°ΡΠ°-ΡΠ΅Π³Π°: var adress=$(this).data('src') //ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΏΠΎΠ»ΡΡΠ΅Π½Π½ΠΎΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ Π² src ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ $('#big img').attr('src',adress) }) #gallery img{ cursor:pointer; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="big"> <img src="https://placehold.it/300.png/09f/fff"> </div> <div id="gallery"> <img src="https://placehold.it/100.png/09f/fff" data-src="https://placehold.it/300.png/09f/fff"> <img src="https://placehold.it/100.png/f90/fff" data-src="https://placehold.it/300.png/f90/fff"> <img src="https://placehold.it/100.png/f09/fff" data-src="https://placehold.it/300.png/f09/fff"> <img src="https://placehold.it/100.png/0f9/fff" data-src="https://placehold.it/300.png/0f9/fff"> </div> Source: https://ru.stackoverflow.com/questions/637284/
All Articles