簡體   English   中英

如何使用jQuery為文本設置動畫以向右滑動

[英]How to animate text with jquery to slide to the right

因此,我跟蹤正確和錯誤的答案,並希望從屏幕右側滑動文本。

這是我所擁有的,但是不起作用:

 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> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM