Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1479484

    on the page below I have 2 links called TILMELD DIG VORES NYHEDSBREV.
    The top one is in a popup made with the enfold magnific popup code:

    function inline_popup_enabler(){ ?>
        <script>
        (function($){
          $(window).load(function() {
              $('.inline_popup').magnificPopup({
                type:'inline',
                midClick: true 
              });
          });
        })(jQuery);
        </script>
    <?php }
    add_action('wp_footer', 'inline_popup_enabler');

    I am then using “mfg-hide” in a color section containing some text and a sender.net widget with a signup form. The popup works but the form is not showing up.

    The one on the bottom (which is a footer page) is done using an iframe and you can see the form widget there. It’s the same widget I uses in the tops ection. I also tried adding a code block to that top color section with the javascript I got off the sender page for the form.
    It’s this and they told me to put all the code together in a code block, but that doesn’t work either:

    <script>
      (function (s, e, n, d, er) {
        s['Sender'] = er;
        s[er] = s[er] || function () {
          (s[er].q = s[er].q || []).push(arguments)
        }, s[er].l = 1 * new Date();
        var a = e.createElement(n),
            m = e.getElementsByTagName(n)[0];
        a.async = 1;
        a.src = d;
        m.parentNode.insertBefore(a, m)
      })(window, document, 'script', 'https://cdn.sender.net/accounts_resources/universal.js', 'sender');
      sender('4f4c8522254761')
    </script>
    
    <div style="text-align: left" class="sender-form-field" data-sender-form-id="m8a4fv8kegj7l6vonkw"></div>

    Can you take a look? I like the top popup better but need the form to show up.

    Thanks
    Nancy

    • This topic was modified 1 week, 5 days ago by Munford.
    #1479530

    I also noticed that if I set the page with the magnific to be the footer, then when I click on the popup text it scrolls back up to the top of the page.

    #1479918

    Hi,
    When I test your script iframe “header” “body” tags are empty, so the iframe is not loading.
    I don’t know why. I don’t see any errors.

    Best regards,
    Mike

    #1480121

    could you take a look at the page? I can’t find any errors and it should work in the popup either as a widget or code, right?

    #1480132

    please remember that ( this is definitly not the trouble with your scripts – but just to mention )

    $(window).load(function() {
    

    is deprecated since jQuery 3.x

    you had to use now:

    $(window).on('load', function(){
    
    #1480136

    I don’t write or read php/java script so… not sure.
    Shouldn’t the widget I have on the popup work fine? It works in the iframe in the footer text link.

    • This reply was modified 3 days, 18 hours ago by Munford.
    #1480153

    Another question about the popup link in an iframe in my footer – can that be centered on the page? I have some css that is making it 50% width but it’s aligned left. see attached popup that is off center.

    #1480177

    Hi!

    Thank you for the update.

    Try adjusting the margin of the iframe container to align it to the center.

    #top .mfp-iframe-scaler {
        width: 60%;
        margin: 0 auto;
    }

    View post on imgur.com

    Cheers!
    Ismael

    #1480187

    thanks Ismael.
    Could you take a look at the problem with the magnific popup on that page? I have a widget that is not showing up with a sender.net form in it. I prefer the look of that popup to the iframeif possible.
    thanks
    Nancy

    #1480190

    on the magnificPopup script you have that trigger class: inline_popup – did you set it on a parent-element of the button?
    The button itself got an ID to open – did you think of to give the target that ID – f.e. on your div:

    <div id="target-ID" style="text-align: left" class="sender-form-field" data-sender-form-id="m8a4fv8kegj7l6vonkw"></div>
    
    #1480192

    I didn’t write that script but got it from Sender.net with the form I built there.
    I don’t really understand javascript myself…
    I gave the color section with the widget and code an ID “popup” and “mfp-hide” custom class,
    then my link is: <p style=”text-align: left;”>TILMELD DIG NYHEDSBREVET</p>.
    should I change the script code?

    #1480228

    Hi,

    Thank you for the update.

    Try to remove the sender script from the color section or code block, leave the div container, then replace the inline_popup_enabler with this code.

    function inline_popup_enabler(){ ?>
        <script>
        (function($){
            $(window).on('load', function() {
                $('.inline_popup').magnificPopup({
                    type: 'inline',
                    midClick: true,
                    callbacks: {
                        open: function() {
                            (function (s, e, n, d, er) {
                                s['Sender'] = er;
                                s[er] = s[er] || function () {
                                    (s[er].q = s[er].q || []).push(arguments);
                                }, s[er].l = 1 * new Date();
                                var a = e.createElement(n),
                                    m = e.getElementsByTagName(n)[0];
                                a.async = 1;
                                a.src = d;
                                m.parentNode.insertBefore(a, m);
                            })(window, document, 'script', 'https://cdn.sender.net/accounts_resources/universal.js', 'sender');
                            
                            sender('4f4c8522254761');
                        }
                    }
                });
            });
        })(jQuery);
        </script>
    <?php }
    add_action('wp_footer', 'inline_popup_enabler');

    Let us know the result.

    https://dimsemenov.com/plugins/magnific-popup/documentation.html#api

    Best regards,
    Ismael

    #1480267

    OK now my code block is just:
    <div style=”text-align: left” class=”sender-form-field” data-sender-form-id=”m8a4fv8kegj7l6vonkw”></div>
    and I added the sender code to my functions.php but the form is still not there.

    #1480281

    did you try ismaels code?
    in your div there is no id – only a data-sender-form-id thats why i ask.

    but: you see on ismaels code the callback – so this might be work as expected.
    maybe a delegate : ‘a’,

    is missing – just try first the code above.

    #1480282

    yes I added Ismael’s code and then only that div is in the code block.
    That was what sender.net says to use.
    I can’t write or really read javascript

    #1480307

    Hi,

    It works when we disable the Sender.net email marketing plugin. This plugin registers and initializes the same script, which conflicts with the callback function in the lightbox popup. Do you need this plugin?

    View post on imgur.com

    Best regards,
    Ismael

    #1480327

    The form shows up without the plugin, but it makes the page scroll to the top when I open it.
    I see a problem also if I click on the link and then close it, if I click on it again the form doesn’t show up.

    /*sizing for popup tilmeld form*/
    @media only screen and (min-width: 768px) { 
    #top .mfp-inline-holder .mfp-content {
    width: 50%!important;
    }}
    
    /*@media only screen and (max-width: 768px) { 
    #top .mfp-iframe-scaler {
        height: 90vh;
    }}*/
    @media only screen and (min-width: 768px) { 
    #top .mfp-iframe-scaler {
        width: 60%;
        margin: 0 auto;
    }}

    Is there a way to center align the form in the popup if I wanted the whole thing centered?

    View post on imgur.com


    or else make the popup narrower so it doesn’t look like this on larger screens?

    View post on imgur.com

    The plugin is what was giving me the widget that I use in the iframe link in the active footer, which is disabled now.
    thanks for the help
    Nancy

    • This reply was modified 21 hours, 14 minutes ago by Munford.
    • This reply was modified 21 hours, 5 minutes ago by Munford.
    • This reply was modified 20 hours, 45 minutes ago by Munford.
    • This reply was modified 20 hours, 44 minutes ago by Munford.
    • This reply was modified 20 hours, 18 minutes ago by Munford.
    • This reply was modified 20 hours, 16 minutes ago by Munford.
Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.