gpt4 book ai didi

javascript - 如何用jquery制作文本向右滑动的动画

转载 作者:行者123 更新时间:2023-12-03 10:21:21 25 4
gpt4 key购买 nike

所以我记录正确和错误的答案,并且我想从屏幕右侧滑动文本。

这是我所拥有的,但它不起作用:

document.getElementById('total').innerHTML = "Number of Right Answers: " + right;
document.getElementById('totalw').innerHTML = "Number of Wrong Answers: " + wrong;
$("#total").show("slide", {
direction: "right"
}, 2000);
$("#totalw").show("slide", {
direction: "right"
}, 2000);
<div id="total"></div>
<div id="totalw"></div>

最佳答案

在html文件中添加:

$('#total').html("Number of Right Answers: " + "right");
$('#totalw').html("Number of Wrong Answers: " + "wrong");
$("#total").show('slide', {direction: 'right'}, 1000);
$("#totalw").show( "slide", {direction: "right" }, 2000 );
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.effects.core.js"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.effects.slide.js"></script>
<div id="total"></div>
<div id="totalw"></div>

关于javascript - 如何用jquery制作文本向右滑动的动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29615503/

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