Advertisement
Guest User

Untitled

a guest
Mar 14th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.93 KB | None | 0 0
  1. jQuery(function($)
  2. {
  3.     function getImgUrl()
  4.     {
  5.         var divHead = getElementsByClassName(document, 'ps-carousel-content');
  6.         var imgElement = divHead[0].getElementsByTagName("img");
  7.         var imgUrl = imgElement[1].getAttribute('src');
  8.         return imgUrl.toString();
  9.     }
  10.  
  11.     var myPhotoSwipe = jQuery("#gallery-swipe a").photoSwipe(
  12.     {
  13.         enableMouseWheel: false,
  14.         enableKeyboard: true,
  15.         getToolbar: function(el)
  16.         {
  17.             // Add a download image link
  18.             var link = '<div class="ps-photo-download"></div>';
  19.             jQuery('.ps-carousel').after(link);
  20.             jQuery('.ps-photo-download').on('click', function()
  21.             {
  22.                 console.log(getImgUrl());
  23.             });
  24.  
  25.             return '<div class="ps-toolbar-close"><div class="ps-toolbar-content"></div></div><div class="ps-toolbar-play"><div class="ps-toolbar-content"></div></div><div class="ps-toolbar-previous"><div class="ps-toolbar-content"></div></div><div class="ps-toolbar-next"><div class="ps-toolbar-content"></div></div>';
  26.         }
  27.     });
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement