Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.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
Javascript 悬停/鼠标悬停在IE中未触发,图像挡住了去路_Javascript_Jquery_Css_Internet Explorer - Fatal编程技术网

Javascript 悬停/鼠标悬停在IE中未触发,图像挡住了去路

Javascript 悬停/鼠标悬停在IE中未触发,图像挡住了去路,javascript,jquery,css,internet-explorer,Javascript,Jquery,Css,Internet Explorer,我有一个div,该div中有一个图像,上面有两个div附加了jquery悬停(onmouseover也有同样的问题,所以不是jquery) 问题是在加载图像时,即使div放在图像的顶部,它们也不会触发,因为图像总是在顶部(即使它实际上不在顶部,并且我尝试将其放在z索引的较低位置,但没有帮助) jquery: <script type="text/javascript"> $(document).ready(function () { $(this).find("#largeI

我有一个div,该div中有一个图像,上面有两个div附加了jquery悬停(onmouseover也有同样的问题,所以不是jquery)

问题是在加载图像时,即使div放在图像的顶部,它们也不会触发,因为图像总是在顶部(即使它实际上不在顶部,并且我尝试将其放在z索引的较低位置,但没有帮助)

jquery:

<script type="text/javascript">
$(document).ready(function () {
    $(this).find("#largeInset").find(".content").css("width","0");

    $("#largeInset").hover (function() { 
        $(this).find(".content").animate({width: '100%'}, 500, function() {});
    },
    function() { 
        $(this).find(".content").animate({width: '0'}, 500, function() {});
    });


    $(this).find("#largeArticles").find(".content").css("width","0");

    $("#largeArticles").hover (function() { 
        $(this).find(".content").animate({width: '40%'}, 500, function() {});
    },
    function() { 
        $(this).find(".content").animate({width: '0'}, 500, function() {});
    });

});
</script>

我现在已经通过向div添加内容解决了这个问题。IE只会在您将鼠标移到div中的内容上时触发(可能是因为位置是绝对的?)。我在divs中添加了一个透明的1px图像,但是拉伸到了100%x100%,所以你将鼠标悬停在图像上,它就会触发

不过,这似乎有点混乱


请参阅(将鼠标悬停在图像的两侧)

您能为html中显示的这段内容提供css吗?添加了css,但上面的效果不太好。
<div class="largeContent">
    <img src="<?php  echo $img[0]; ?>" border="0" alt="" title="" />
        <div id="largeInset">
            <div class="content">
            [content]
            </div>
        </div>
        <div id="largeArticles">
            <div class="content">

            <ul> (loop fills this)
                <li>
                [content]
                </li>
            </ul>
            </div>
            <br style="clear: both;" />
        </div>
    </div>
    .articles { position: relative; width: 100%; padding: 0; float: left; background-color: #fff; }
.large { margin: 0 0 10px; border: 0px solid #000; min-height: 200px; }
.large img { max-width: 100%; min-width: 100%; min-height: 350px; z-index: -1; }

.largeContent { z-index: 99; position: absolute; top: 0; width: 100%; height: 100%; }
.filler { width: 100%; height: 100%; }
#largeInset { position: absolute; top: 0; right: 0; min-height: 100%; width: 25%; color: #fff; }
#largeInset .head { padding: 10px 0; }
#largeInset p { font-size: 0.9em; margin: 5px 10px; }
#largeInset .content { overflow: hidden; position: absolute; top:0; background-color: #000; right: 0; color: #fff; }

#largeArticles { position: absolute; top: 0; left: 0; width: 25%; min-height: 100%; }
#largeArticles .content { overflow: hidden; position: absolute; top: 0; left: 0; width: 40%; background-color: #000; }