scripts.js 806 B

12345678910111213141516171819202122232425262728
  1. var GlobalLastProductImage = '';
  2. function ShopProductImagesLightGallery() {
  3. $('#product_thumbnails').lightGallery({
  4. pager: false,
  5. showThumbByDefault: false,
  6. toogleThumb: false,
  7. controls: false,
  8. download: false
  9. });
  10. $('#product_image img').css('cursor', 'pointer').click(function() {
  11. $($('#product_thumbnails a.thumbnail').get($(this).data('index'))).click();
  12. });
  13. $('#product_thumbnails a.thumbnail').each(function() {
  14. $(this).mouseover(function() {
  15. if($(this).data('hover') != GlobalLastProductImage) {
  16. GlobalLastProductImage = $(this).data('hover');
  17. $('#product_image img').attr('src', $(this).data('hover'));
  18. $('#product_image img').data('index', $(this).data('index'));
  19. }
  20. });
  21. });
  22. }
  23. // Init all
  24. $(document).ready(function() {
  25. ShopProductImagesLightGallery();
  26. });