gpt4 book ai didi

javascript - 悬停时的文本滚动不适用于 jQuery 2.2.0

转载 作者:太空宇宙 更新时间:2023-11-04 09:16:24 24 4
gpt4 key购买 nike

我使用 jQuery 在悬停 div 上滚动文本的代码:

HTML:

<div style="width: 390px; margin-left: 50px; background-color: #ddd;">
<div class="tooMuchWrapper"><span class="tooMuchText tooMuchText1">Got too much text to fit in your content area? Just hover for more more more more more more!</span></div>
</div>

JS:

$(function() {
$("#tooMuchText1").hoverForMore({
"speed": 300,
"loop": false
});
});

CSS:

.tooMuchText {
overflow: hidden;
white-space: nowrap;
display: block;
text-align: left;
text-overflow: ellipsis;
cursor: default;
}

但实际上我的代码不起作用。我使用 jQuery 2.2.0 进行测试。我该如何解决这个问题?

演示 JSFIDDLE

最佳答案

在你的 JSFIDDLE 中,删除第 275 行的 }...更新版本:

$(function()
{
$(".tooMuchText1").hoverForMore({
"speed": 300,
"loop": false,
});
});

https://jsfiddle.net/wzhpbhcf/1/

关于javascript - 悬停时的文本滚动不适用于 jQuery 2.2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41738138/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com