JavaScript 通过悬停另一个项目来切换显示/隐藏div

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript 通过悬停另一个项目来切换显示/隐藏div相关的知识,希望对你有一定的参考价值。

<script type="text/javascript">
$(document).ready(function() {    
    var hide = false;
        jQuery("img.shadow").hover(function(){
            if (hide) clearTimeout(hide);
            jQuery(".post_share").fadeIn();
        }, function() {
            hide = setTimeout(function() {jQuery(".post_share").fadeOut("slow");}, 250);
        });
        jQuery(".post_share").hover(function(){
            if (hide) clearTimeout(hide);
        }, function() {
            hide = setTimeout(function() {jQuery("post_share").fadeOut("slow");}, 250);
        });
});
</script>

以上是关于JavaScript 通过悬停另一个项目来切换显示/隐藏div的主要内容,如果未能解决你的问题,请参考以下文章