Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery MVC 4 Razor图像鼠标悬停在显示较大图像上_Jquery_Image_Asp.net Mvc 4_Razor - Fatal编程技术网

Jquery MVC 4 Razor图像鼠标悬停在显示较大图像上

Jquery MVC 4 Razor图像鼠标悬停在显示较大图像上,jquery,image,asp.net-mvc-4,razor,Jquery,Image,Asp.net Mvc 4,Razor,有人知道添加JQuery的方法吗?它允许用户悬停在Razor中foreach循环中动态创建的未知id上?当图像被鼠标悬停或悬停时,我需要抓取id并执行.show();为了这个形象。我有它在一个图像的其他页面上工作,但不知道如何处理许多未知id的图像 这是包含两个图像的image div。完整图像显示在较小图像的上方,并在鼠标悬停或不悬停时消失 <div class="listEntriesPhoto" style="display:inline-block; vertical-align:

有人知道添加JQuery的方法吗?它允许用户悬停在Razor中foreach循环中动态创建的未知id上?当图像被鼠标悬停或悬停时,我需要抓取id并执行.show();为了这个形象。我有它在一个图像的其他页面上工作,但不知道如何处理许多未知id的图像

这是包含两个图像的image div。完整图像显示在较小图像的上方,并在鼠标悬停或不悬停时消失

<div class="listEntriesPhoto" style="display:inline-block; vertical-align:top;">
            <img id="EntriesDiagramLeft-@item.ImageName" src='~/documents/@item.ImageName' alt="repeating default photo of woman" />

            <!--This is for image hover for larger picture-->
            <div id="EntriesFullDiagramLeft-@item.ImageName" style="display:none;" >
                <img id="EntriesfullImageLeft-@item.ImageName" src='~/documents/@item.ImageName' alt="Submitted image"/>
            </div>
        </div>


任何帮助都会很好,请提前感谢

这应该能帮到你:

  var photoList = $(".listEntryPhoto").find("img");
  .each(photoList, function(){
          var image = $(this);
          // Whatever code you used for one image goes here
          // using the image variable
    };

类“listEntriesPhoto”是您的根div元素吗?嗨,Jared!我终于有时间回应了,因为我本来是在一个紧迫的最后期限上,然后就忘了。不管怎么说,我给了你这个答案,因为我最终拼凑了你贴的东西和我已经有的东西,效果非常好!下面是代码:下面是代码:$(“.diagramlefit”).mouseenter(函数(){$(this.next(.fulldiagramlefit”).show('normal');})$(“.fulldiagramleeft”).mouseleave(函数(){$(this.hide('normal');});