jQuery 部分代码无效
Part of jQuery code not working
似乎在 mmenu 插件之后没有 jQuery 代码工作。有人可以建议是什么问题吗?我想要的是在悬停时强制更改 span 标签内的文本;然而,这并没有发生。我尝试使用其他一些功能,但效果不佳。我是不是漏了括号什么的?
$(document).ready(function() {
$("#my-menu").mmenu({
extensions: [
"border-none",
"effect-slide-menu",
"pageshadow",
"theme-white"
],
navbar: {
add: false
}
});
$("#skype-change").mouseover(function() {
$("#skype-change span").text("Whatever I wish to see here!");
});
});
还有一点 HTML。
<p class="text-close" id="skype-change"><span><i class="fa fa-skype"></i></span></p>
#skype-change
p
标签在 #my-menu
里面吗?
如果使用委托事件呢?
例如
$(document).on("mouseover", "#skype-change", function()
{
[...]
});
现在一切正常。由于未知原因,我什么也没做,等待了大约 25 分钟该代码才起作用。
似乎在 mmenu 插件之后没有 jQuery 代码工作。有人可以建议是什么问题吗?我想要的是在悬停时强制更改 span 标签内的文本;然而,这并没有发生。我尝试使用其他一些功能,但效果不佳。我是不是漏了括号什么的?
$(document).ready(function() {
$("#my-menu").mmenu({
extensions: [
"border-none",
"effect-slide-menu",
"pageshadow",
"theme-white"
],
navbar: {
add: false
}
});
$("#skype-change").mouseover(function() {
$("#skype-change span").text("Whatever I wish to see here!");
});
});
还有一点 HTML。
<p class="text-close" id="skype-change"><span><i class="fa fa-skype"></i></span></p>
#skype-change
p
标签在 #my-menu
里面吗?
如果使用委托事件呢? 例如
$(document).on("mouseover", "#skype-change", function()
{
[...]
});
现在一切正常。由于未知原因,我什么也没做,等待了大约 25 分钟该代码才起作用。