繁体   English   中英

jQuery:附加元素方法不起作用

[英]jQuery: Appended Element methods don't work

我将以下通知附加到通知容器的代码如下。 我想在添加通知后淡入通知,但它告诉我该函数未定义,但是jQuery的hide方法工作正常。

const notification = $(this.generateNotificationCode(text)).prependTo(this.container);
// works
notification.hide().fadeIn();

// notification.hide(...).fadeIn is not a function
notification.hide();

而是使用:

notification.fadeIn();

没关系,我捆绑了jQuery slim而不是jQuery-我错过了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM