Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #293672

    Hi,

    I hava a inline element inside this code:

    <div id="ok" class="white-popup mfp-hide">

    I would like to open the same directly in URL in address bar. I using the address in the “private content”, but the same is not loading the popup.

    What is the problem?

    THANKS

    #293733

    Hey CloudChoice!

    Thank you for using the theme.

    I’m sorry but what do you mean by “opening inline element in the address url”? Can you please explain it a little bit further?

    Cheers!
    Ismael

    #293738

    Hi,

    I’m talking about opening a magnific popup element directly in the url or the deeplink of element.

    For example: image.jpg opened would be site.com/#image.jpg and going to that URL would trigger the Magnific-Popup to open right off with that image.

    Thanks

    #294511

    Hi!

    Please read the documentation of magnific popup: http://dimsemenov.com/plugins/magnific-popup/ . You can’t easily open a modal box without some custom code. I did a quick test on my website though and if a paste following code into a “Code” element:

    
    <script>
    (function($)
    {
    $(function () {
    	$('.popup-modal').magnificPopup({
    		type: 'inline',
    		preloader: false,
    		focus: '#username',
    		modal: true
    	});
    	$(document).on('click', '.popup-modal-dismiss', function (e) {
    		e.preventDefault();
    		$.magnificPopup.close();
    	});
    });
    })(jQuery);
    </script>
    <style>
    .white-popup-block {
    background: #FFF;
    padding: 20px 30px;
    text-align: left;
    max-width: 650px;
    margin: 40px auto;
    position: relative;
    }
    </style>
    <a class="popup-modal" href="#test-modal">Open modal</a>
    
    <div id="test-modal" class="mfp-hide white-popup-block">
            <h1>Modal dialog</h1>
            <p>You won't be able to dismiss this by usual means (escape or
              click button), but you can close it programatically based on
              user choices or actions.</p>
            <p><a class="popup-modal-dismiss" href="#">Dismiss</a></p>
    </div>
    

    I can reproduce the demo content of the magnific popup website.

    Cheers!
    Peter

    #294531

    HI,

    Ok. I agree, but the fact is:
    Are you able to open this modal in a deep link?

    In other words, open the popup direct typing the URL in the address bar?

    THANKS

    #294539

    Hi!

    Not without some additional code which checks the hash values and triggers the modal box if necessary. I guess a skilled js developer can do this with 1-2 hours of work but it’s just a rough estimate. If you need help with it please hire a freelancer – i.e. from http://studio.envato.com/

    Cheers!
    Peter

    #294599

    HI

    I get it. Appreciate the attention.

    THANKS

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Open inline element directly in the address bar (url)’ is closed to new replies.