zoukankan      html  css  js  c++  java
  • JavaScript实现的功能

    1.js事件阻止冒泡的应用

      1)问题描述:

        单机除了这两个元素,触发事件,

        可用阻止事件冒泡

      2)解决方法:  

        $('body').click(function(e){
            $('#searchTree').css("display","none");
            $('#searchText').css("display","none");
            $('#customerOwn').removeClass('highLight');
            $('#equipIdOrName').removeClass('highLight');
        })

    //增加的2个条件单击事件
    //设备号或名字
    $('#equipIdOrName').click(function(e){
    e.stopPropagation();//阻止这个事件向上冒泡
    $('#searchTree').css("display","none");
    $('#searchText').css("display","inline-block").attr("placeholder","设备号/设备名称");
    $(this).addClass('highLight');
    $('#customerOwn').removeClass('highLight');
    });
    //所属客户
    $('#customerOwn').click(function(e){
    e.stopPropagation();
    $('#searchText').css("display","none");
    $('#searchTree').css("display","inline-block");
    $(this).addClass('highLight');
    $('#equipIdOrName').removeClass('highLight');
    });

     

      

  • 相关阅读:
    Android 引用资源
    Android res目录结构
    Android 目录结构
    ubuntu 14.04 (desktop amd 64) 查看配置参数
    ros service
    install ros-indigo-map-server
    python 单例
    查看指定目录空间占用
    shell 设置超时时间
    nohup 不生成 nohup.out的方法
  • 原文地址:https://www.cnblogs.com/xiaoping1993/p/7146556.html
Copyright © 2011-2022 走看看