- MooTools 教程
- MooTools——主页
- MooTools——介绍
- MooTools——安装
- MooTools——程序结构
- MooTools——选择器
- MooTools——使用数组
- MooTools——函数
- MooTools——事件处理
- MooTools——DOM 操作
- MooTools——样式属性
- MooTools——输入过滤
- MooTools——拖放
- MooTools——正则表达式
- MooTools——期刊
- MooTools——滑块
- MooTools——可排序对象
- MooTools——手风琴
- MooTools——工具提示
- MooTools——选项卡式内容
- MooTools——类
- MooTools——Fx.Element
- MooTools——Fx.Slide
- MooTools——Fx.Tween
- MooTools——Fx.Morph
- MooTools——Fx.Options
- MooTools——Fx.Events
- MooTools 实用资源
- MooTools——快速指南
- MooTools——实用资源
- MooTools——讨论
MooTools——Quint 运动
本教程将展示五次方运动,即进入、退出和进出事件。我们举个例子,我们将向 div 元素添加一个 鼠标按压 事件以及五次方事件。请看以下代码。
示例
<!DOCTYPE html>
<html>
<head>
<style>
#quintic_in {
width: 100px;
height: 20px;
background-color: #F4D03F;
border: 2px solid #808B96;
}
#quintic_out {
width: 100px;
height: 20px;
background-color: #F4D03F;
border: 2px solid #808B96;
}
#quintic_in-out {
width: 100px;
height: 20px;
background-color: #F4D03F;
border: 2px solid #808B96;
}
</style>
<script type = "text/javascript" src = "MooTools-Core-1.6.0.js"></script>
<script type = "text/javascript" src = "MooTools-More-1.6.0.js"></script>
<script type = "text/javascript">
window.addEvent('domready', function() {
$('quintic_in').addEvent('mousedown', function(event) {
this.set('tween', {duration: 'long', transition: 'quint:in'});
this.tween('width', [80, 400]);
});
$('quintic_out').addEvent('mousedown', function(event) {
this.set('tween', {duration: 'long', transition: 'quint:out'});
this.tween('width', [80, 400]);
});
$('quintic_in-out').addEvent('mousedown', function(event) {
this.set('tween', {duration: 'long', transition: 'quint:in-out'});
this.tween('width', [80, 400]);
});
});
</script>
</head>
<body>
<div id = "quintic_in"> Quintic : in</div><br/>
<div id = "quintic_out"> Quintic : out</div><br/>
<div id = "quintic_in-out"> Quintic : in-out</div><br/>
</body>
</html>
您将获得以下输出
输出
mootools_fxoptions.htm
广告