【发布时间】:2014-02-10 17:07:08
【问题描述】:
来自世界各地的 Stack Overflow 员工您好!希望你们都做得很好!我今天只有一个查询。我刚刚发现了一个很棒的 css3 库,叫做 animate.css http://daneden.github.io/animate.css/,我正在尝试用 jquery mobile 来实现它来定制我的应用程序页面转换。我试图从一个页面转到另一个页面,并将 animate.css 类应用于页面 div,但是在发生花哨的转换之后,页面仍然在同一页面上并且没有到达目标页面。如果有人对如何实现这一目标有任何线索,请告诉我。谢谢这里的代码:
CSS:
<link href="./css/animate.css" rel="stylesheet" />
Javascript:
<script language="javascript">
$(function() {
$("a#home").click(function() {
animate(".box-a", 'rotateOutDownRight');
return false;
});
});
function animate(element_ID, animation) {
$(element_ID).addClass(animation);
var wait = window.setTimeout( function(){
$(element_ID).removeClass(animation)}, 1300
);
}
</script>
HTML:
<!------- HOME PAGE ---------------------------------------->
<div data-role="page" id="home" data-theme="c" class="box-a animated"> <!--Inicia pagina home -->
<div data-role="header"><h1>Animate</h1></div>
<div data-role="content">
<p><a id="home" href="#pagina2">Box A will flash, click here!</a></p>
<a id="home" href="#pagina2" data-role="button">PAGE 2 W/ANIMATION.CSS</a>
<a href="#pagina2" data-role="button">PAGE 2 W/O ANIMATION.CSS</a>
</div> <!-- End of div content -->
<div data-role="footer" data-position="fixed"><h3>Animate</h3></div>
</div>
<!----- PAGE 2 ----------------------->
<div data-role="page" id="pagina2" data-theme="c"> <!--Inicia pagina home -->
<div data-role="header"><h1>Animate</h1></div>
<div data-role="content">
<p>PAGE 2</p>
</div> <!-- End of div content -->
<div data-role="footer" data-position="fixed"><h3>Animate</h3></div>
</div>
网址:在此处查看示例:http://apps.alfonsopolanco.com
【问题讨论】:
标签: javascript jquery html css jquery-mobile