`
wandejun1012
  • 浏览: 2690013 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

javaonclick传递event

    博客分类:
  • JS
阅读更多

 

标签:js阻止事件冒泡

 

假设在html中有个onclick="showpopup()",在函数showpopup传一个名为event参数过去,

 

即是如下格式:onclick="showpopup(event)",那么在javascript的函数中可以接受到事件源。

 

 

见下述例子:

function showpopup(event){

   stopBubble(event);//将event再次传递,调用stopBubble,即可阻止了js的事件冒泡。

}

 

 

 

   //阻止冒泡事件
    function stopBubble(e) {
        if (e && e.stopPropagation) {//非IE
            e.stopPropagation();
        }
        else {//IE
            window.event.cancelBubble = true;
        }
    }

 

refurl:http://justcoding.iteye.com/blog/587876

 http://blog.csdn.net/xxd851116/article/details/4234188

http://www.jb51.net/article/9858.htm

分享到:
评论

相关推荐

    FreeRTOS传递结构体例程、传递数据指针例程.7z

    使用FreeRTOS的消息队列传递结构体,值传递拷贝方式;传递指针所存储的地址,实现更高效的数据访问!

    eventsource-polyfill.js

    为IE浏览器添加EventSource兼容性支持。为IE浏览器添加EventSource兼容性支持。

    Event_Log_Explorer_4.3.8.zi

    + Added Custom columns - you can extract information from description and display it in event list. + Added alerts by event type. * NewAPI: Event description could be missing for some events. Fixed. *...

    EventLog Analyzer 12.2.1

    ManageEngine EventLog Analyzer 12.2.1

    EVENT TAG EVENT TAG EVENT TAG

    Activity Details独木舟水球同乐日 及 独木舟水球邀请赛 @ 迪欣湖 [2010年7月3,4日...独木舟水球邀请赛将 迪欣湖活动中心举行ㄛ欢迎光临观赛〔详情请 览 http://www.facebook.com/event.php?eid=115015881876447 ...

    EventLog_Analyzer.zip

    Eventlog Analyzer日志管理系统、日志分析工具、日志服务器的功能及作用  Eventlog Analyzer是用来分析和审计系统及事件日志的管理软件,能够对全网范围内的主机、服务器、网络设备、数据库以及各种应用服务系统等...

    Windows2016 EventLog Analyzer安装部署.pptx

    Windows2016 EventLog Analyzer安装部署 1.产品概览 2.功能介绍 3.版本对比 4.硬件要求 5.操作系统要求 6.安装Windows Server 2016 7.EventLog Analyzer使用的端口 8.部署EventLog Analyzer 9.应用EventLog Analyzer

    Event Streams in Action: Real-time event systems with Kafka and Kinesis

    Event Streams in Action: Real-time event systems with Kafka and Kinesis。 Writing real-world applications in a data-rich environment can feel like being caught in the cross fire of a paintball battle....

    event.keycode大全(javascript)

    event.keycode大全(javascript) event.keycode大全(javascript) event.keycode大全(javascript) event.keycode大全(javascript) event.keycode大全(javascript)

    ManageEngine EventLogAnalyzer 12.04

    ManageEngine EventLogAnalyzer 12.04 license文件,亲测可用。

    visualevent.zip

    好用的visualevent,不一定要用谷歌哦,百度或者360都可以安装此插件。

    Visual Event.rar

    用Chrome插件Visual Event查看Dom绑定的事件 Visual Event简介 Visual Event是一个开源Javascript 书签,能提供绑定在DOM元素上的事件调试信息。Visual Event能显示如下信息: 1、哪一个元素有事件绑定 ...

    Video-based event recognition

    single-thread action is represented by a stochastic finite automaton of event states, which are recognized from the characteristics of the trajectory and shape of moving blob of the actor using ...

    ManageEngine EventLog Analyzer 12.2.1

    ManageEngine Eventlog Analyzer是用来分析和审计系统及事件日志的管理软件,能够对全网范围内的主机、服务器、网络设备、数据库以及各种应用服务系统等产生的日志,进行全面收集和细致分析,通过统一的控制台进行...

    教你7步实现flex自定义Event与参数传递.doc

    教你7步实现flex自定义Event与参数传递.doc

    Event Based Programming

    Event Based Programming

    shiro-event-1.4.0-API文档-中英对照版.zip

    赠送jar包:shiro-event-1.4.0.jar; 赠送原API文档:shiro-event-1.4.0-javadoc.jar; 赠送源代码:shiro-event-1.4.0-sources.jar; 赠送Maven依赖信息文件:shiro-event-1.4.0.pom; 包含翻译后的API文档:shiro-...

    Windows Event Log 日志管理工具

    Windows Event Log 日志管理工具,功能包括添加Event Source,添加Event Log,删除Event Source,删除EventLog. 可用于Web项目发布中对自定义日志的管理。 因需要一定系统访问权限,请使用管理员权限登录使用。

    Event Processing in Action PDF

    Event Processing in Action introduces the major concepts of event-driven architectures and shows how to use, design, and build event processing systems and applications. Written for working software ...

    [JS]详尽解析window.event对象

    event代表事件的状态,例如触发event对象的元素、鼠标的位置及状态、按下的键等等。 event对象只在事件发生的过程中才有效。 event的某些属性只对特定的事件有意义。比如,fromElement 和 toElement 属性只对 ...

Global site tag (gtag.js) - Google Analytics