我有一个由各种图像组成的画廊。单击图像时,它会展开以显示图像的放大版本和右侧的一些文本。我添加了社交分享按钮,但我很幸运能够检索到图像的实际链接。这是我到目前为止所做的。
<div class="grid__item" data-size="1280x857">
<a href="candle.jpeg" class="img-wrap"><img src="candle.jpeg" alt="img06" /></a>
<div class="description description--grid">
<h3>Candle Light</h3>
<div class="details">
<ul>
<li><i class="icon icon-film"></i><span>Harry Potter and the Prisoner of Azkaban</span></li>
</ul>
</div>
<div>
<ul class="share-buttons">
<li><a href="https://www.facebook.com/sharer/sharer.php?u=&t=" title="Share on Facebook" target="_blank" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.URL)); return false;"><img src="img/social-buttons/Facebook.png"></a></li>
<li><a href="https://twitter.com/intent/tweet?source=&text=:%20" target="_blank" title="Tweet" onclick="window.open('https://twitter.com/intent/tweet?text=' + encodeURIComponent(document.title) + ':%20' + encodeURIComponent(document.URL)); return false;"><img src="img/social-buttons/Twitter.png"></a></li>
<li><a href="https://plus.google.com/share?url=" target="_blank" title="Share on Google+" onclick="window.open('https://plus.google.com/share?url=' + encodeURIComponent(document.URL)); return false;"><img src="img/social-buttons/Google+.png"></a></li>
<li><a href="http://www.linkedin.com/shareArticle?mini=true&url=&title=&summary=&source=" target="_blank" title="Share on LinkedIn" onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;"><img src="img/social-buttons/LinkedIn.png"></a></li>
<li><a href="mailto:?subject=&body=:%20" target="_blank" title="Email" onclick="window.open('mailto:?subject=' + encodeURIComponent(document.title) + '&body=' + encodeURIComponent(document.URL)); return false;"><img src="img/social-buttons/Email.png"></a></li>
</ul>
</div>
</div>
</div>
我可以创建一个共享链接,在扩展视图中共享此特定图像或任何特定图像吗?目前它正在使用正在共享的URL。我不确定如何获取URL中图像的链接。