如何使用 css3 数据转换?
How do I use css3 data-transition?
css3 似乎有 transition
和 data-transition
.
I want to use the effects from here,但我不太确定如何让它们工作。我来自 css2 和 html4,这些东西对我来说是新的。已经阅读和搜索了几个小时,我有点不知所措。
我尝试将 data-transition: turn;
放入我的 css 中作为 <a>
元素,并且我尝试将其放入 html 中作为 <a href='#' data-transition='turn'>link</a>
.
基本上,transition
用在CSS
里面
.class {
color: red;
transition: color 0.25s;
}
/* have the element fade to yellow on hover*/
.class:hover {
color: yellow;
}
data-transition
在 jQuery 框架内使用。尝试查看 this page 以获取有关数据转换的信息。
您需要在代码中包含 jQuery 和 jQuery Mobile 才能使用数据转换,
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js">
这个例子可能会帮助你理解它是如何工作的,因为我对 jQuery 和 jQuery 手机不是很熟悉:
Here and Here
css3 似乎有 transition
和 data-transition
.
I want to use the effects from here,但我不太确定如何让它们工作。我来自 css2 和 html4,这些东西对我来说是新的。已经阅读和搜索了几个小时,我有点不知所措。
我尝试将 data-transition: turn;
放入我的 css 中作为 <a>
元素,并且我尝试将其放入 html 中作为 <a href='#' data-transition='turn'>link</a>
.
基本上,transition
用在CSS
.class {
color: red;
transition: color 0.25s;
}
/* have the element fade to yellow on hover*/
.class:hover {
color: yellow;
}
data-transition
在 jQuery 框架内使用。尝试查看 this page 以获取有关数据转换的信息。
您需要在代码中包含 jQuery 和 jQuery Mobile 才能使用数据转换,
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js">
这个例子可能会帮助你理解它是如何工作的,因为我对 jQuery 和 jQuery 手机不是很熟悉:
Here and Here