如何使用css3数据转换



css3似乎有transitiondata-transition

我想使用这里的效果,但我不太确定如何让它们发挥作用。我来自css2和html4,这些东西对我来说都是新的。已经阅读和搜索了几个小时,我有些不知所措。

我尝试将data-transition: turn;放在我的css中作为<a>元素,并尝试将其作为<a href='#' data-transition='turn'>link</a>放在html中。

您需要在代码中包含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 Mobile不是很熟悉:
Here and Here

基本上,transition在CSS 内部使用

.class {
color: red;
transition: color 0.25s;
}
/* have the element fade to yellow on hover*/
.class:hover {
color: yellow;
}

data-transition在jQuery框架内部使用。请尝试查看此页面以获取有关数据转换的信息。

最新更新