我正尝试使用css动画创建一个完整的页面转换。我在路上来到了一个岔路口。我在链接上放置了一个类,并使用JQuery调用它,然后将css类应用于页面以激活转换。现在,当我分配新的窗口位置时,它想要覆盖动画。这就像我可以有一个或另一个,而不是两个,至少不是我如何做它......任何提示?我的页面转换不起作用
下面的代码
$(document).ready(function() {
var linkLocation
$("a.transition").click(function(event){
event.preventDefault();
linkLocation = this.href;
redirectPage();
});
function redirectPage() {
$("body").attr('class', 'page-rotateSlideOut');
window.location = linkLocation;
}
});
删除
$("body").attr('class', 'page-rotateSlideOut');
而不是创造全球varible,这将是很好的传递参数的功能直接'redirectPage(this.href);'和'功能redirectPage(linkLocation) ' –