Meteor iron-router set route for overlay

我的未来我决定 提交于 2020-01-15 05:25:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!