问题
I wanted to implement the overlay effect like Atmospherejs.com by iron-router when overlay has the specific route (https://atmospherejs.com/?q=). Does anyone have any idea?
回答1:
It doesn't have route, by the way. As you can see nothing between domain name and query parameter. and It just triggering of UI element on some click.
Something like following from CodeDrops might help for your usecase -
Demo here: http://tympanus.net/Development/FullscreenOverlayStyles/index5.html
Code for same and article here: http://tympanus.net/codrops/2014/02/06/fullscreen-overlay-effects/
回答2:
I searched for a long time on how to accomplish this, but what I ended up doing was defining an empty action on the route.
Router.route('/login', {
action: function () {
},
onAfterAction: function () {
Session.set('loginOpen', true);
}
});
This caused the route to be triggered, but didn't change the current template. I then set a session variable to open up the modal. This has been working great for me so far.
来源:https://stackoverflow.com/questions/27934720/meteor-iron-router-set-route-for-overlay