我放弃了。我如何获得Velocity定义。没有一个例子显示这一点,并且正确;它应该很容易。我试图在没有JQuery的情况下使用velocity version 1.2.3,(根据GitHub在九天前发布)。我通过从GitHub直接下载到我的网页获得了第一个版本(较早的版本,1.2.2),然后将我的网页保存为velocity.js。第二个是通过访问https://github.com/julianshapiro/velocity获得velocity.js并将其保存为Velocity123.js。速度未定义
这个测试程序是为了帮助我开始使用velocity,但是由于Velocity未定义的情况,我还无法到达那里,正如FireFox v 40.0.3的webdeveloper/webconsole报告的那样。未定义的Velocity的其他FAQ实例似乎不适用,因为他使用的是过时的JQuery版本。在velocity1.2.3中,我看到了Velocity的实际定义,并且我已经找到了该文件。我已经通过复制它并在将/ DIR更改为\之后对它进行DIR测试来测试文件定义,那么它如何不能被定义呢?测试代码是:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test1 Velocity</title>
<meta charset="utf-8"/>
<!-- Standard download from GitHub
<script src="C:/Users/dbd/Documents/Library4thFloor/velocity.js">
</script>
-->
<!-- Suggested by wikipedia
<script src="//cdn.jsdelivr.net/velocity/1.2.2/velocity.min.js">
</script>
-->
<!-- manually included from github latest -->
<script src="C:/Users/dbd/Documents/Library4thFloor/Velocity123.js">
</script>
<script type="text/JavaScript">
function press(){
alert("entered press");
var idrect = document.getElementById("sq");
alert("after idrect is set");
Velocity(idrect, {opacity:0.3},{duration:2,easing:"ease-in-out",loop:5});
return false;
}
</script>
</head>
<body>
<h1>Sample SVG with Velocity</h1>
<br>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400" height="400">
<rect id="sq"
x="25"
y="25"
width="200"
height="200"
fill="lime"
stroke-width="4"
stroke="pink"
onclick="press()"
/>
</svg>
</body>
</html>
根据我的阅读,你所引用的表单只能用于JQuery。如果没有JQuery,根据文档,表单会更改为: –
对不起,我还没有流利地使用stack-overflowspeak:它在中途中断了我。正如我所说,如果没有使用JQuery,表单会变为:Velocity(。{},{duration:... etc。谢谢您的试用。 –
我发现在Chrome浏览器下提交的代码工作正常,但在IE或FireFox下却没有,这改变了它可以在FireFox下工作的问题,文档中的某处声称Velocity是独立于浏览器的;必须加入考虑各种浏览器是不要求与速度。这似乎与此相矛盾,但我希望一旦开始在任何地方开展工作,一切都会变得清晰。 –