简体   繁体   中英

BackboneJS Magnific Popup not working

I have this Backbone App where I want to use the Magnific Popup for my login. So I created a View

var userTopNavigation = Backbone.View.extend({
        tagName: 'ul',
        className : 'nm',
        template: 'userNavigationItem',
        events: {
            'click .login': 'login',
        },
        login: function(e){
            e.preventDefault();
            $('.login').magnificPopup({
                disableOn: 700,
                type: 'inline',
                removalDelay: 160,
                preloader: false,
                fixedContentPos: false
            });
        }
});

My HTML-userNavigationItem template looks like:

<li>
  <a href="#" class="login">
      <span class="navpptxt">Login</span>
  </a>  
</li>

Then on my index.php I placed the popup:

<div id="loginbox" class="white-popup mfp-hide">...some content here...</div>

So I can see that the Magnific popup -script is loaded and the only thing what happens is that when I click the <a href="#" class="login"> - the Modal bagground gets loaded, but not my popup!!?

What could be the issue here? Do i have to place the popup div somewhere else?

您想使用弹出式窗口而不是登录按钮来调用登录框:$('#loginbox')。magnificPopup({

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM