我想在文本中做一个动画,从右到左隐藏文本,但是字母是在动画之后安装的......
我知道我可以使用 white-space: nowrap
但我需要将其视为一个段落
如何在没有镶嵌字母的情况下为这段文字制作动画?
setTimeout(function () {
$("#title").animate({width: 'hide'});
$("#description").animate({width: 'hide'});
$("#text1").animate({width: 'hide'});
},2000);
.bold{
font-size: 48px;
color: black;
width: 400px;
}
.normal{
font-size: 48px;
color: black;
width: 400px;
}
#container{
width: 452px;
height: 625px;
}
#description{
margin-top: 40px;
margin-bottom: 50px;
}
#description,#text1{
margin-left: 25px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container" >
<div id="title" class="bold">
1231231231123
</div>
<div id="description"class="normal">asd asd as da sd asdfsdfasdfasd asd fsadf asdf asdfasdf.</div>
<div id="text1" class="bold">
aaaaaaaaaaaaaaaa aaaaaaaaaaaa
</div>
</div>
最佳答案
如果可能,根据您的布局,您应该为#container
设置动画:
setTimeout(function () {
$("#container").animate({
width: 'hide'
});
}, 2000);
关于javascript - 文本中的动画,从右到左隐藏文本已安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29792767/