Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function($)
- {
- function getImgUrl()
- {
- var divHead = getElementsByClassName(document, 'ps-carousel-content');
- var imgElement = divHead[0].getElementsByTagName("img");
- var imgUrl = imgElement[1].getAttribute('src');
- return imgUrl.toString();
- }
- var myPhotoSwipe = jQuery("#gallery-swipe a").photoSwipe(
- {
- enableMouseWheel: false,
- enableKeyboard: true,
- getToolbar: function(el)
- {
- // Add a download image link
- var link = '<div class="ps-photo-download"></div>';
- jQuery('.ps-carousel').after(link);
- jQuery('.ps-photo-download').on('click', function()
- {
- console.log(getImgUrl());
- });
- 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>';
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement