javascript - jQuery On Page Load Animation 不工作

标签 javascript jquery html css

我试图在页面加载时运行动画,但它不起作用我在页面加载时使用字体大小更改不透明度,但它没有显示任何效果

$(".animation").animate({opacity: 0.1, font-size:20px}, 1500 );
$(".animation").animate({opacity: 0.5, font-size:30px}, 500 );
$(".animation").animate({opacity: 0.9, font-size:40px}, 100 );
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1 class="animation">Checking</h1>

最佳答案

你忘了引号

 $(".animation").animate({"opacity": "0.1", "font-size":"20px"}, 1500 );
    $(".animation").animate({"opacity": "0.5", "font-size":"30px"}, 500 );
    $(".animation").animate({"opacity": "0.9", "font-size":"40px"}, 100 );  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1 class="animation">Checking</h1>

关于javascript - jQuery On Page Load Animation 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39144970/

相关文章:

jquery - ajax的每个请求都会给出响应数据

javascript - jquery去除烦恼

javascript - 如何使用 Node 'http' 重定向到目标 url

javascript - 软边 html5 Canvas

javascript - 减少 ajax 搜索功能的消耗,在用户输入时延迟 3 秒

php - 表格没有垂直对齐

javascript - 压缩重复的 jQuery 函数

javascript - iOS:这家伙用什么样的工具来制作这个演示的原型(prototype)?

javascript - 如何滚动浏览在 chrome 的嵌入标签中打开的 PDF?

javascript - 我如何使用 jquery 根据 url 中的关键字更改 css 类