【发布时间】:2016-07-28 18:31:27
【问题描述】:
我正在继续我对 Meteor 的学习,它正在慢慢融合在一起,我正在构建一些远离教程的东西。我想为动画等添加一些额外的非功能性 JS,并决定使用我熟悉的 Greensock。我在 main.html 的正文中包含了 TweenMax 的 CDN,并一直在模板帮助程序中调用它。
Main.html:
<head>
<title>NO-TEA-FY</title>
<link rel="stylesheet" href="css/noteafy.css" id="stylesheet">
模板:
<template name="mainInit">
<div class="teaContainer">
<h1 class="superJumboHeader">Tea</h1>
</div>
模板助手:
$(document).ready(function(){
// If the user doesn't click on Tea within 3 seconds of arriving, shake the word
setTimeout(function () {
var teaCont = $(".teaContainer");
TweenMax.to(teaCont, 1, {css:{"margin-top":"25%"}, ease:Power3.easeOut});
}, 3000);
});
Jquery 运行正常,但我得到:
未捕获的 ReferenceError:未定义 TweenMax。
我想知道为什么找不到 TweenMax 而 JQuery 可以?
谢谢。
【问题讨论】:
-
CDN 的引用在哪里?您没有在 Main.html 中显示它。
-
嗯,粘贴时发生了一些事情 - 它就在那里。不过现在问题已经解决了。