zoukankan      html  css  js  c++  java
  • 浮动层的显示与隐藏

    但一个区域,鼠标完全放在上面,就会出现一个背景层,移开,然胡隐藏。当鼠标横扫过去,很快的时候,浮动层会停止上面不显示。

    修改后的代码:

    html:

     1 <div class="box3">
     2             <php>if($arroundTravelInfo){</php> 
     3             <img class="arroundImg" src="{$arroundTravelInfo.img}" />
     4             <div class="nearbyBlackBox">
     5                 <span class="span1">{$arroundTravelInfo.product_name}</span>
     6                 <span class="span2">{$arroundTravelInfo.sale|default="0"}会去</span>
     7                 <span class="span3">
     8                     <span class="s1">¥{$arroundTravelInfo.price_current|default="0"}</span>
     9                     <span class="s2">¥{$arroundTravelInfo.price|default="0"}</span>
    10                 </span>
    11                 <a href="{$arroundTravelInfo.url}">我想去</a>
    12             </div>
    13             <php>}</php>
    14             <div class="nearbyBlackBoxBg"></div>
    15             
    16         </div>
    17            
    18         <div class="box3_detail" style="display:none;">
    19                <img src="{$arroundTravelInfo.img}" />
    20             <div class="nearbyBlackBox" onclick="window.open('{$arroundTravelInfo.url}')">
    21             <span class="span1">{$arroundTravelInfo.nearby_name}</span>
    22                <div class="blackBox_p">{$arroundTravelInfo.seo_description}</div>
    23                <span class="span3">
    24                     <span class="s1">¥{$arroundTravelInfo.price_current|default="0"}</span>
    25                     <span class="s2">¥{$arroundTravelInfo.price|default="0"}</span>
    26             </span>
    27                <span class="span2">{$arroundTravelInfo.sale|default="0"}会去</span>
    28                <a href="{$arroundTravelInfo.url}">我想去</a>
    29                </div>
    30             <div class="nearbyBlackBoxBg"></div>
    31         </div>

    js:

    var mflag = false;
    
    function bgShow() {
        $('.box3_detail').show();
        $('.box3').hide();
    }
    
    function bgHide() {
        if(!mflag){
            $('.box3_detail').hide();
            $('.box3').show();
        }
    }
    $('.box3 img.arroundImg').mouseenter(function(){
            bgShow();
        });
        
        $('.box3 img.arroundImg').mouseleave(function(){
            window.setTimeout(bgHide, 10);
        });
        
        $('.box3_detail').mouseover(function(){
            mflag = true;
        });
        
        $('.box3_detail').mouseleave(function(){
            mflag = false;    
            bgHide();
        });
  • 相关阅读:
    详解SQL Server的两个存储过程:sp_MSforeachtable/sp_MSforeachdb
    使用WorkService创建定时任务
    Mahout下个性化推荐引擎Taste介绍
    Apache Mahout中的机器学习算法集
    内网信息收集笔记 楼下的小可怜
    关于linux的suid提权 楼下的小可怜
    Cobalt Strike初探 楼下的小可怜
    Google hacking 楼下的小可怜
    Git和Repo扫盲——如何取得Android源代码 zt
    Howto find native code memory leak in Android
  • 原文地址:https://www.cnblogs.com/xingmeng/p/3412776.html
Copyright © 2011-2022 走看看