Lightgallery Share plugin

Share plugin allows you to share your images to Twitter, Facebook, Pinterest and Google plus.

Plugin dependency

Lightgallery require the hash and lg-share plugins to be included in your document.

HTML structure

<div id="lg-share">
  <a data-pinterest-text="Pin it1" data-tweet-text="share on twitter 1" href="img/img1.jpg">
      <img src="img/thumb1.jpg" />
  </a>
  <a data-pinterest-text="Pin it2" data-tweet-text="share on twitter 2" href="img/img2.jpg">
      <img src="img/thumb2.jpg" />
  </a>
  ...
</div>

Optionally you can pass separate url for each images instead of current browser url.

<div id="lg-share">
  <a data-pinterest-text="Pin it1" data-tweet-text="share on twitter 1" data-facebook-share-url="facebook-share.html" data-twitter-share-url="twitter-share.html" data-googleplus-share-url="googleplus-share.html" data-pinterest-share-url="pinterest-share.html" href="img/img1.jpg">
      <img src="img/thumb1.jpg" />
  </a>
  <a data-pinterest-text="Pin it1" data-tweet-text="share on twitter 1" data-facebook-share-url="facebook-share.html" data-twitter-share-url="twitter-share.html" data-googleplus-share-url="googleplus-share.html" data-pinterest-share-url="pinterest-share.html" href="img/img2.jpg">
      <img src="img/thumb2.jpg" />
  </a>
  ...
</div>

Javascript

lightGallery(document.getElementById('lg-share'));