Problem: unable to post the desired picture.
html fragment
<div class="wrap-img"> <div class="share-img-soc"> <div class="skin skin_light"> <div class="share-link-list social-likes social-likes_visible"> <li class="share-img fb social-likes__widget social-likes__widget_facebook" data-service="facebook" data-url="" data-media="" data-image=""><span class="social-likes__button social-likes__button_facebook"><span class="social-likes__icon social-likes__icon_facebook"></span></span><span class="social-likes__counter social-likes__counter_facebook social-likes__counter_empty"></span></li> <li class="share-img vk social-likes__widget social-likes__widget_vkontakte" data-service="vkontakte" data-image=""><span class="social-likes__button social-likes__button_vkontakte"><span class="social-likes__icon social-likes__icon_vkontakte"></span></span><span class="social-likes__counter social-likes__counter_vkontakte social-likes__counter_empty"></span></li> <li class="share-img ok social-likes__widget social-likes__widget_odnoklassniki" data-service="odnoklassniki" data-image=""><span class="social-likes__button social-likes__button_odnoklassniki"><span class="social-likes__icon social-likes__icon_odnoklassniki"></span></span></li> </div> </div> </div> <img alt="" src="/images/mclasses/714//image20.jpg" style="width: 450px; height: 600px;"> </div> Description: when hovering over pictures, icons with social networks appear, by pressing which only that picture in the area of which I made the guidance should fast. In this case, I can not post the desired picture.
Trying to do by analogy how here
jqery
$(function(){ $('body').on('click', '.share-img', function(){ var url = $(this).closest('wrap-img').attr('src'); if($(this).hasClass('fb')){ window.open('https://www.facebook.com/sharer/sharer.php?u='+url, 'Share Facebook', config='height=300, width=500'); } }); }); main library from here