Tagged: , ,

Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #492445

    Hi,

    I using Enfold and I need that when I click in a button it’s show a Modal Popup with a code and also open a link in other tab.

    It’s possible open a modal popup and also open a new tab?

    Can you help me?

    Thanks
    Regards.

    #492507

    Hey!

    You could have two links, like:

    <a href='#' id='link_to_another_tab'>Link to Another Tab</a>
    <a href='#?iframe=true' id='link_to_modal_popup' style='display: none;'>Link to Modal PopUp</a>

    And then with jQuery chain trigger them, like:

    $('#link_to_another_tab').on('click', function(){
          $('#link_to_modal_popup').trigger('click');
    });

    Cheers!
    Josue

    #910299

    Hi Josue.
    This works well in chrome, but in firefox or safari the iframe shows up empty.
    any idea of a workaround?

    #910304

    you have seen the publishing time?
    August 24, 2015 at 9:46 pm

    #910389

    yes, why? do you know of something particular that has changed over the last 2.5 years regarding jquery/iframe support?
    let me know if you have another better approach regarding that.

    #910874

    Hi,

    Did you adjust the value of the href attribute with the iframe parameter? In the example above, it will display a blank page. Please create a test page so that we can inspect it.

    Best regards,
    Ismael

    #910966

    Ok, so I found out that it works fine except when the “triggering” link points to a file.

    So this works perfectly in all browsers :

    <a id='triggering_link' href='#'>Click me</a>
    <a id='link_to_modal_popup' href='https://www.mywebsite.com/nicepage/?iframe=true'></a>

    but the following only works in chrome :

    <a id='triggering_link' href='https://www.mywebsite.com/fileToDownload.zip'>Click me</a>
    <a id='link_to_modal_popup' href='https://www.mywebsite.com/nicepage/?iframe=true'></a>

    any idea why is that ?
    private content : link to a page where you can test the 2 things above

    ps: the jquery chain :

    jQuery('#triggering_link').on('click', function(){
                jQuery('#link_to_modal_popup').trigger('click');
            });
    #911041

    Hi goch,

    I was not able to see the page. Please check in private.

    Best regards,
    Victoria

    #911298

    Hi Victoria
    not sure why is that. It’s in password protected mode, so you should be able to see it.
    Have you entered the password? you don’t have access to the page at all?

    #911505

    Hi,

    I get the same problem as Victoria on my end, do you have any ip blocking active maybe?

    Best regards,
    Rikard

    #911565

    not sure what’s going on.. anyway, I just made the page public, you should be able to see it now! :)

    #911579

    i noticed here on my end a code for functions.php of your child theme:
    i set the trigger-class to open-popup-link

    function popup_script() { 
    ?>
    <script type="text/javascript">
    jQuery(window).load(function(){
      jQuery('.open-popup-link').magnificPopup({
        type:'inline',
        midClick: true
      });
    });
    </script>
    <?php }
    
    add_action('wp_head', 'popup_script');
    #911625

    Hi goch,

    Have you tried the solution by Guenni007?

    Let us know if this helps or you need more help from us.

    Best regards,
    Victoria

    #911666

    hum… sorry, I don’t understand how to use Guenni’s code…
    here is my current function :

    function trigger_popup_on_linkClick(){
       ?>
        <script>
            jQuery('#triggering_link').on('click', function(){
                jQuery('#link_to_modal_popup').trigger('click');
            });
        </script>
        <?php
    }
    add_action('wp_footer', 'trigger_popup_on_linkClick');

    as you can see it makes reference to both my “triggering_link” (the one the user clicks), and the “link_to_modal_popup” (the one which shows up in the iframe).
    But Guenni’s code only make use of 1 id (“open-popup-link”). How can I link it to my “triggering_link” ?

    #911714

    well it is a custom-class first.

    I have interpreted your desire to have a popup modal window on a link

    every link you can setup (in text-block or as alb element like a button) you can give a custom class to.
    so if there is a link like <a class="open-popup-link" href=" … </a> it will than open in a modal window.

    the code itself comes to child-theme functions.php

    i have that problem too on a flyout in which i placed a link to a film – allthough i add that ?iframe=true (or &iframe=true– depending if there is allready a ? ) it does not open in a popup window.

    #911736

    I could not get your script to work unfortunately. Do you have a working example somewhere?

    I have interpreted your desire to have a popup modal window on a link

    Yes, what I want is :
    I have a link pointing to a file.
    When the user clicks that link the file is downloaded, and I want to open another page in a modal window at the same time.

    The solution I posted above works perfectly in chrome, but not in firefox/safari.

    #912039

    Hey!

    The download and the modal window are working properly on Firefox. The download is starting automatically on Chrome but on Firefox, it’s asking for a confirmation which is normal.

    Cheers!
    Ismael

    #912077

    The download and the modal window are working properly on Firefox.

    you mean it works when you click the “click me with download” link on the page I posted?
    Here (on last macOS) it only works in chrome. With last firefox (58.0.2) or safari (11.0.3) (both without any plugin) the download is started and the popup is displayed, but the popup is fully black. You can’t see any content inside (cf screen recording in private data)

    #912569

    Hi,

    Yes, it’s working on Firefox Windows 7. It might be related to the browser settings. Do you see any error in the console after the click? Here’s how the console can be accessed.

    Firefox: https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console
    Safari: https://support.apple.com/en-ph/guide/safari/use-the-safari-develop-menu-sfri20948/mac

    Best regards,
    Ismael

    #912678

    – firefox:
    no error, nothing is printed in the console
    – safari:
    I got the following error printed :
    Failed to load resource: Frame load interrupted

    #913088

    Hi,

    It seems to be a general issue on safari browser, not sure how to fix it though.

    // https://github.com/eligrey/FileSaver.js/issues/215

    I’m afraid you’ll have to separate the download and modal link for now.

    Best regards,
    Ismael

    #913162

    ok. thanks for having a look. A pity there’s no way to do such a simple thing.
    I guess I will open the popup only in chrome, and for the other browsers I’ll open the link in another tab.
    thanks

    #913418

    Hi,

    Thank you for your understanding we much appreciate it.

    Best regards,
    Basilis

Viewing 23 posts - 1 through 23 (of 23 total)
  • The topic ‘Is possible show a modal popup and also open a link ?’ is closed to new replies.