所以我跟踪正确和错误的答案,我想从屏幕右侧滑动文本。
这是我所拥有的,但它不起作用:
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>
&#13;
答案 0 :(得分:1)
添加文件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 );
&#13;
<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>
&#13;