-
AuthorPosts
-
July 21, 2014 at 1:22 am #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
July 21, 2014 at 8:35 am #293733Hey 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!
IsmaelJuly 21, 2014 at 8:53 am #293738Hi,
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
July 22, 2014 at 6:07 pm #294511Hi!
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!
PeterJuly 22, 2014 at 7:15 pm #294531HI,
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
July 22, 2014 at 7:51 pm #294539Hi!
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!
PeterJuly 22, 2014 at 10:13 pm #294599HI
I get it. Appreciate the attention.
THANKS
-
AuthorPosts
- The topic ‘Open inline element directly in the address bar (url)’ is closed to new replies.