Popup link structure

LGALLP
348 Posts
LGALLP posted this 21 January 2020
Wishlist

Hello, Team.

How to create Popup Windows now that you changed the pages and blocks links structure?

I´m trying to build a Popup section but now with all the changes you made in the pages and blocks "ways" to link, it doesn´t let me apply de "-popup" texto to the section when applying the link to a button and neither changing the section name or ID because it appears as part of the name and not as like a "command" to hide the block and then open it when click on the button... It stays as an Anchor Link.

What´s the new trick for making popup windows in the actual version?

Thank you for your time. Have a good day.

Hello, Team. How to create Popup Windows now that you changed the pages and blocks links structure? I´m trying to build a Popup section but now with all the changes you made in the pages and blocks "ways" to link, it doesn´t let me apply de "-popup" texto to the section when applying the link to a button and neither changing the section name or ID because it appears as part of the name and not as like a "command" to hide the block and then open it when click on the button... It stays as an Anchor Link. What´s the new trick for making popup windows in the actual version? Thank you for your time. Have a good day.

Last edited 21 February 2023 by Support Team

Vote to pay developers attention to this features or issue.
11 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 28 January 2020

Hi Luis,

Sorry for the delay.
The solution is almost the same.
The Button link should look as follows:

modal-link.png

Here "mymodal" is the Block Anchor of the second block. You can use any. I also changed the code a little.

<style>
/* The MIT License (MIT) Copyright (c) 2014 Toby */
/* demo only */
.flex { display: flex; }
.align-center { justify-content: center; }
.align-vert,.align-vert.align-center { align-items: center; }
/* end demo */

.modal { display: none; }
.modal--show,
.modal--hide { display: flex; } /* classes fired by js for animation control */

/* This is on the wrapper for the whole modal */
.modal--align {
  width: 100%;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
}

.modal__container {
  position: relative;
  width: 100%;
  max-width: 1300px;
  padding: 20px 20px 0px 20px;
  margin: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

/* As there is no href to avoid the hash being added to the URL when clicked we add a pointer */
/* This 'x' is hidden from screen readers as there is an accessible close button in the modal */
.modal__close--x:hover {
  cursor: pointer;
}

/* Animations */
/* Open */
.modal.modal--show {
  animation: modal-open 0.3s;
}

@keyframes modal-open {
  0%    { opacity: 0; }
  100%  { opacity: 1; }
}

/* Close */
.modal.modal--hide {
  animation: modal-close 0.3s;
}

@keyframes modal-close {
  0%    { opacity: 1; }
  100%  { opacity: 0; }
}

.modal__close--x {
  position: absolute;
  line-height: 19px;
  top: 10px;
  right: 10px; 
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  font-family: "Open Sans", "Arial","sans-serif";
  opacity: .2;
}

.modal {
  text-align: center;
}
</style>

<style>
    .modal__container [class*="section"] {
        display: block !important;
        overflow: hidden;
    }
    .modal__close--x {
        z-index: 1;
    }
</style>

<script>
var buttonSelector = 'a[href*="-popup"]',
    parseId = function (href) { return href.replace('-popup', '').replace('#', ''); };
window.onload = function () {
    $('body').on('click', buttonSelector, function (event) {
        var id = parseId(event.currentTarget.getAttribute('href'));

        var modalId = 'modal-' + id;
        if ($('#' + modalId).length === 0) {
            $('body').append('<div class="flex align-center align-vert modal modal--align" id="' + modalId + '">' +
                '    <div class="modal__container">' +
                '        <span class="modal__close modal__close--x" aria-hidden="true">×</span>' +
                '        ' + document.getElementById(id).outerHTML +
                '    </div>' +
                '</div>');      
        }
        $('#' + modalId).addClass('modal--show');
    });


    var closeModal = function (modal) {
        modal.removeClass('modal--show');
        modal.addClass('modal--hide');

        var afterAnimation = function () {
            modal.removeClass('modal--hide');   
        };

        // This listens for the CSS animations to finish and then hides the modal
        modal[0].addEventListener("webkitAnimationEnd", afterAnimation, false);
        modal[0].addEventListener("oAnimationEnd", afterAnimation, false);
        modal[0].addEventListener("msAnimationEnd", afterAnimation, false);
        modal[0].addEventListener("animationend", afterAnimation, false);
        setTimeout(afterAnimation, 400);
    }

    // Close the modal with any element with class 'modal__close'
    $('body').on('click', '.modal__close', function (e) {
        closeModal($(e.currentTarget).closest('.modal'));
    });


    // Click outside of the modal and close it
    window.onclick = function (e) {
        if ($(e.target).is('.modal')) {
            closeModal($(e.target));
        }
    }

    // Use the escape key to close modal
    document.onkeyup = function (e) {
        e = e || window.event;
        if (e.keyCode == 27 && $('.modal--show').length === 1) {
            closeModal($('.modal--show'));
        }
    }
};

document.addEventListener("DOMContentLoaded", function(event) {
    var buttons = document.querySelectorAll(buttonSelector);
    for (var i = 0; i < buttons.length; i++) {
        var section = document.getElementById(parseId(buttons[i].getAttribute('href')));
        if (section) {
            section.style.display = 'none';
        }       
    }
});
</script>

...................................................
Sincerely,
Olivia
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Luis, Sorry for the delay. The solution is almost the same. The Button link should look as follows: !modal-link.png! Here "mymodal" is the Block Anchor of the second block. You can use any. I also changed the code a little. <style> /* The MIT License (MIT) Copyright (c) 2014 Toby */ /* demo only */ .flex { display: flex; } .align-center { justify-content: center; } .align-vert,.align-vert.align-center { align-items: center; } /* end demo */ .modal { display: none; } .modal--show, .modal--hide { display: flex; } /* classes fired by js for animation control */ /* This is on the wrapper for the whole modal */ .modal--align { width: 100%; height: 100%; position: fixed; left: 0; top: 0; background: rgba(0, 0, 0, 0.3); z-index: 999; } .modal__container { position: relative; width: 100%; max-width: 1300px; padding: 20px 20px 0px 20px; margin: 12px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; } /* As there is no href to avoid the hash being added to the URL when clicked we add a pointer */ /* This 'x' is hidden from screen readers as there is an accessible close button in the modal */ .modal__close--x:hover { cursor: pointer; } /* Animations */ /* Open */ .modal.modal--show { animation: modal-open 0.3s; } @keyframes modal-open { 0% { opacity: 0; } 100% { opacity: 1; } } /* Close */ .modal.modal--hide { animation: modal-close 0.3s; } @keyframes modal-close { 0% { opacity: 1; } 100% { opacity: 0; } } .modal__close--x { position: absolute; line-height: 19px; top: 10px; right: 10px; font-size: 32px; font-weight: 700; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; font-family: "Open Sans", "Arial","sans-serif"; opacity: .2; } .modal { text-align: center; } </style> <style> .modal__container [class*="section"] { display: block !important; overflow: hidden; } .modal__close--x { z-index: 1; } </style> <script> var buttonSelector = 'a[href*="-popup"]', parseId = function (href) { return href.replace('-popup', '').replace('#', ''); }; window.onload = function () { $('body').on('click', buttonSelector, function (event) { var id = parseId(event.currentTarget.getAttribute('href')); var modalId = 'modal-' + id; if ($('#' + modalId).length === 0) { $('body').append('<div class="flex align-center align-vert modal modal--align" id="' + modalId + '">' + ' <div class="modal__container">' + ' <span class="modal__close modal__close--x" aria-hidden="true">×</span>' + ' ' + document.getElementById(id).outerHTML + ' </div>' + '</div>'); } $('#' + modalId).addClass('modal--show'); }); var closeModal = function (modal) { modal.removeClass('modal--show'); modal.addClass('modal--hide'); var afterAnimation = function () { modal.removeClass('modal--hide'); }; // This listens for the CSS animations to finish and then hides the modal modal[0].addEventListener("webkitAnimationEnd", afterAnimation, false); modal[0].addEventListener("oAnimationEnd", afterAnimation, false); modal[0].addEventListener("msAnimationEnd", afterAnimation, false); modal[0].addEventListener("animationend", afterAnimation, false); setTimeout(afterAnimation, 400); } // Close the modal with any element with class 'modal__close' $('body').on('click', '.modal__close', function (e) { closeModal($(e.currentTarget).closest('.modal')); }); // Click outside of the modal and close it window.onclick = function (e) { if ($(e.target).is('.modal')) { closeModal($(e.target)); } } // Use the escape key to close modal document.onkeyup = function (e) { e = e || window.event; if (e.keyCode == 27 && $('.modal--show').length === 1) { closeModal($('.modal--show')); } } }; document.addEventListener("DOMContentLoaded", function(event) { var buttons = document.querySelectorAll(buttonSelector); for (var i = 0; i < buttons.length; i++) { var section = document.getElementById(parseId(buttons[i].getAttribute('href'))); if (section) { section.style.display = 'none'; } } }); </script> ................................................... Sincerely, Olivia Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
LGALLP
348 Posts
LGALLP posted this 28 January 2020

Hello, Olivia! No problem for the delay, I know you´re busy.

Thank you for the update and the instructions, I´ll try it and let you know if everything works fine. Also I´ll publish it as html code in my website for latinamerican people who maybe working with NP and the info may be important for them.

Thank y ou again. Have a good day.

Hello, Olivia! No problem for the delay, I know you´re busy. Thank you for the update and the instructions, I´ll try it and let you know if everything works fine. Also I´ll publish it as html code in my website for latinamerican people who maybe working with NP and the info may be important for them. Thank y ou again. Have a good day.
Support Team
Support Team posted this 29 January 2020

Hi Luis,

Thanks, you are welcome. Please let us know if you need any further help.

...................................................
Sincerely,
Hella
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Luis, Thanks, you are welcome. Please let us know if you need any further help. ................................................... Sincerely, Hella Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
LGALLP
348 Posts
LGALLP posted this 29 January 2020

Good morning!

This one worked even better than the previous code that you had in earlier versions of Nicepage.
Thanks a lot!

This is the link to the post in my personal website: http://www.lgallp.site/popup-window-html-para-nicepage/

Good morning! This one worked even better than the previous code that you had in earlier versions of Nicepage. Thanks a lot! This is the link to the post in my personal website: http://www.lgallp.site/popup-window-html-para-nicepage/
Support Team posted this 30 January 2020

Hi Luis,

That's great! Feel free to contact г on any other occasion.

...................................................
Sincerely,
Hella
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Luis, That's great! Feel free to contact г on any other occasion. ................................................... Sincerely, Hella Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
LGALLP
348 Posts
LGALLP posted this 19 November 2021

Hi, guys! Wish you a good day.

Why this code works when link applied to a button but not when applied to and image thumbnail? I need to publish several videos into a new website I´m building but using the video blocks gives me the problem that those blocks and video got shrinked depending on which device the website is visited... So, I would like to take video screenshots to put the image and link them to popup windows that will show each video kinda like "Full Screen" or "Lights Out" features...

Can you help me to achieve this with a code that work almost in any type of element I would like to put the link or convert it into a button for the popup to open?

Thank you for your time and help.

Hi, guys! Wish you a good day. Why this code works when link applied to a button but not when applied to and image thumbnail? I need to publish several videos into a new website I´m building but using the video blocks gives me the problem that those blocks and video got shrinked depending on which device the website is visited... So, I would like to take video screenshots to put the image and link them to popup windows that will show each video kinda like "Full Screen" or "Lights Out" features... Can you help me to achieve this with a code that work almost in any type of element I would like to put the link or convert it into a button for the popup to open? Thank you for your time and help.
Support Team
Support Team posted this 23 November 2021

Hi Luis,

You do not need to use a code. Add a Group control, then insert your video into the Group. In the Group control options select the Hyperlink option and set the modal popup to be shown when the group link is pressed.

...................................................
Sincerely,
Hella
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Luis, You do not need to use a code. Add a Group control, then insert your video into the Group. In the Group control options select the Hyperlink option and set the modal popup to be shown when the group link is pressed. ................................................... Sincerely, Hella Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
LGALLP
348 Posts
LGALLP posted this 18 February 2023

Hi. Nicepage Team. Wish you a good day.

This code doesn´t work anymore... that´s a shame. You´re getting greedier :P

Hi. Nicepage Team. Wish you a good day. This code doesn´t work anymore... that´s a shame. You´re getting greedier :P
Support Team
Support Team posted this 20 February 2023

Hello Luis,

Wishing a good day too :)

Can you please elaborate more on that? Do you need another modal popup for your website?

This code doesn't work because the Modal popups are available in the Quick Acess Panel >> Modal Popups.

For your type of premium, you can use only one.

Thank you
...................................................
Sincerely,
Ahmad.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Luis, Wishing a good day too :) Can you please elaborate more on that? Do you need another modal popup for your website? This code doesn't work because the Modal popups are available in the Quick Acess Panel >> Modal Popups. For your type of premium, you can use only one. Thank you ................................................... Sincerely, Ahmad. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
LGALLP
348 Posts
LGALLP posted this 21 February 2023

Hi, Ahmad! Thank you for your answer. Wish you a good day!

Yes, well that´s exactly the "problem"... That the capabilities of creating popup windows applying a code are no longer available even paying at least a personal license/subscription (I know my license/subscription is expired by now)... But, when it was active, I can only create ONE popup, because of the code and hiding block option was taken out!

Is there another/new way to create popups with code when paying at least a personal license/subscription or there´s no other way than to upgrade to even expensive license/subscription?

I mean, if anybody pay at least the cheaper license/subscription should have more option even if they are "the hard way" like applying codes and things they may have to rush a lot for how to get them to work...

Please, send this to the cheaf staff and provide us with some solutions... don´t limitate us that much! I´m sure that if we could pay expensive licenses/subscriptions to make our ways easier, we will... but we pay the "personal" because can´t expend more... but we pay it cause we like Nicepage Builder and I´m sure that if you guys let us build with capabilities we may have to learn and evolve ourself, maybe we could get to upgrade our licences/subscriptions as we grow in clients and website design skills... which generally turns into more profit for us to invest in Nicepage Builder greater plans to get even better for our clients.

Thank you for your time.

Hi, Ahmad! Thank you for your answer. Wish you a good day! Yes, well that´s exactly the "problem"... That the capabilities of creating popup windows applying a code are no longer available even paying at least a personal license/subscription (I know my license/subscription is expired by now)... But, when it was active, I can only create ONE popup, because of the code and hiding block option was taken out! Is there another/new way to create popups with code when paying at least a personal license/subscription or there´s no other way than to upgrade to even expensive license/subscription? I mean, if anybody pay at least the cheaper license/subscription should have more option even if they are "the hard way" like applying codes and things they may have to rush a lot for how to get them to work... Please, send this to the cheaf staff and provide us with some solutions... don´t limitate us that much! I´m sure that if we could pay expensive licenses/subscriptions to make our ways easier, we will... but we pay the "personal" because can´t expend more... but we pay it cause we like Nicepage Builder and I´m sure that if you guys let us build with capabilities we may have to learn and evolve ourself, maybe we could get to upgrade our licences/subscriptions as we grow in clients and website design skills... which generally turns into more profit for us to invest in Nicepage Builder greater plans to get even better for our clients. Thank you for your time.
Support Team
Support Team posted this 21 February 2023

Luis,

We have forwarded your suggestions to the dev.

...................................................
Sincerely,
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Luis, We have forwarded your suggestions to the dev. ................................................... Sincerely, Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
You must log in or register to leave comments