0

このコードの何が問題なのか誰か教えてもらえますか? 画像ギャラリーがあり、ギャラリーのすべての画像にポップアップを追加したいのですが、同じ画像でしか開きません。さまざまな例を試してみましたが、ほとんどの場合、すべてのギャラリー リンクではなく、1 つのリンクに対してのみ機能します。

カートアイコンをクリック

ここに私のフィドルがあります....

 $(document).ready(function(){



//Image pop on mouseover
$("#gallery2 a").append('<span id=myspan class=myspanclass><a  id=deleteimg href="#"      class="delete" ></a><a href="#" class="showreranks" id="d" ><img      src="images/insert_to_shopping_cart.png" class="imgOpa" size=20 width=20 border=0></a></span>');

$(this).find('#gallery2 a.showreranks').append('<div id="popupdiv" class="closemediv"><div class="closemediv"><a href=""><img src="http://icons.iconarchive.com/icons/kyo-tux/aeon/16/Sign-Close-icon.png" width="16"></a></div><div id="list_preview" class="popupcontent"><p>Some Text!</div></div>');




//makes sure when deleting image it does not pops the fancybox
 $('span a').bind('click', function(e) {
e.stopPropagation();

 });

  $(".photo-link").on({

mouseenter: function () {

 $(this).find('span').stop().delay(100).fadeIn(200);
},
mouseleave: function () {
  $(this).find('span').stop(true).fadeOut(0);
 }
   });





 //Popup Div Start
  $(function () {
   $('a.showreranks').click(function () {
     position = $(this).position();
    $('body').append('<div class="overlay"></div>')
    $('#popupdiv').fadeIn(300);
    $('#popupdiv').css('top', position.top + 17);
    return false;
  });
    });

     (function (a) { 
      jQuery.fn.screencenter = function () {
     this.css("position","absolute");
    this.css("top", (($(window).height() - this.outerHeight()) / 2) +            $(window).scrollTop() + "px");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) +   $(window).scrollLeft() + "px");
    return this;
}  
         })(jQuery);
      //Popup Div End


         }); 
       </SCRIPT>
4

1 に答える 1