As shown below, the class tag 'nav_hover' has been removed. It is expected that the binding event handler 'hover' should be detached to the DOM.
However the trigger is still there even the aim li has no class named 'nav_hover'.
To solve the problem , we must use the binding method for furture elements.
$(document).on(event,selector,function);
In this senario, the code that works is :
$(document).on("mouseenter",".nav_hover",function(){
$(this).css("background-color", "#ee8296");
});
$(document).on("mouseleave",".nav_hover",function(){
$(this).css("background-color", "#fff");
});
I have no idea how to combine 'hover' and 'on' together.
Well that does not matter as it works already.
- 大小: 32.6 KB
分享到:
相关推荐
removed removedremoved removed
WM_Removed_讲义(2)
[removed][removed] [removed] $('.form-control-chosen').chosen({ allow_single_deselect: true, width: '100%' }); $('.form-control-chosen-required').chosen({ allow_single_deselect: false,...
rmc触发 React触发组件 发展 npm install ... < Trigger xss=removed> popup < / span > } popupAlign = { { points : [ 'tl' , 'bl' ] , offset : [ 0 , 3 ] } } > < a href = '#'> hover
[removed]转码[removed]转码[removed]转码
Learning [removed] The non-boring beginner’s guide to modern (ES6+) JavaScript programming Vol 1: The language core By 作者: Marco Emrich – Christin Marit ISBN-10 书号: 1983138541 ISBN-13 书号: ...
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
zabbix-agent2-5.0.7-1.el7.x86_64.rpm
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
Removed-A电商平台企业财务风险评价及防范对策研究 Removed-A电商平台企业财务风险评价及防范对策研究是基于 Removed-A电商平台企业的实际情况,针对其经营中存在的财务风险进行识别和评价,找出风险成因,并提出...
is often used interchangeably with the work “chapter”, this is also a leftover from the class handouts. Eventually, such comments will be corrected or removed from the text. Furthermore, many of the...
本文实例讲述了JS创建Tag标签的方法。分享给大家供大家参考,具体如下: 一 . 创建标签其原理就是 创建一个节点; var x = document.createElement(TagName) 赋予节点样式; x.setAttribute(class,类名) 对节点...
#Lava.ClassManager 的独立版本 请参阅文档: : ##注意力! 独立的 ClassManager 是自包含的(它不依赖于 MooTools,就像主...// [removed][removed] // namespaces is a must Lava . ClassManager . registerRoot
网页中的javascript脚本代码往往需要在文档加载完成后才...[removed]是一个事件,当文档加载完成之后就会触发该事件,可以为此事件注册事件处理函数,并将要执行的脚本代码放在事件处理函数中,于是就可以避免获取不
<figure v-bind:class="filter.className" class="mh0 mb0 mt2 db bg-transparent aspect-ratio aspect-ratio--1x1"> <div class="aspect-ratio--object cover" v-bind: backgroundImage: 'url(' source ')' }"> ...
React标签列表输入 中预先提供的标签列表的输入元素。 接口 <TagListForm tags={require: xss=removed strict={optional:> 生成特定的 DOM 结构: < div class =' tag-list-form '> ... class =' tag-list-form-
Trigger.io 的谷歌分析 这是一个基本的 JavaScript 库,允许您在应用程序中使用 Google Analytics 跟踪。 该插件使用了两个 Trigger.io 模块,并在您... [removed][removed] 包含后,将以下代码添加到您的主 JavaScript
[removed][removed] [removed][removed] [removed][removed] </head> <body>[removed][removed] <select id="country" class="dept_select"> <select id="province" class="dept_select"> ...
代码片段: <title>jQuery仿手机通讯录首字母查找联系人代码</title>...link rel="stylesheet" type="text/css" href="css/style.css?...[removed][removed] ...<div class="container">...[removed][removed]
vue提供了一个动态添加class的v-bind:class(:class) 对象,可以使用:class进行clas动态的切换。案例中将通过使用:class设置 字体为红色。 1、新建一个html代码页面。 2、在html代码页面创建一个同时添加id为app...