javascript - meteor 铁:router transitions

标签 javascript meteor css-transitions

我正在尝试使用iron:router 来实现页面之间的转换。我在 css 中定义了动画,现在我需要的就是用iron:router 调用它们。由于某种原因,以下代码:

animateContentOut = function() {
    $('#content').removeClass("animated fadeIn");
    return $('footer').addClass("hide");
}

fadeContentIn = function() {
    $('#content').addClass("animated fadeIn");
    return $('footer').removeClass("hide");
}

Router.onBeforeAction(animateContentOut);
Router.onAfterAction(fadeContentIn);

返回异常:

Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?

最佳答案

根据 Iron-Router 文档中的规定,现在 onBeforeActiononAfterAction 回调都需要 this.next()https://github.com/iron-meteor/iron-router

因此,只需将该行添加到 fadeContentInanimateContentOut 代码的末尾即可。

关于javascript - meteor 铁:router transitions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34643947/

相关文章:

jquery - CSS 滤镜模糊 : Prevent Undefined Image Edges on a Blurred Image during CSS Transition

webkit 浏览器中的 CSS 过渡填充故障

css - 为什么 webkit 浏览器的转换持续时间总是固定的?

meteor - 使用 MeteorJS 的 LinkedIn API

installation - Meteor 有计划支持 Gentoo 吗?

javascript - 在 mousedown 和 mouseup 事件后防止点击事件

javascript - 为什么 Material-UI Appbar onLeftIconButtonTouchTap 不起作用?

php - 使用 php 脚本连接 rockat.chat mongo 数据库

javascript - 从 Chrome 扩展程序访问 Google Analytics window._gaq

javascript - 将 javascript 添加到 Rails 应用程序页面