• Resolved steplab

    (@steplab)


    Sorry about that, after the fix of the issue of the link in the popup there is another error.
    When a popup is opened you hide scrollbar of window:

    
    html.popup-modal-open, html.popup-modal-open body {
    	overflow: hidden;
    }
    

    And if I click a link on the popup, the url is correctly opened and the popup disappeared:

    
    if (typeof event.target.href !== 'undefined' || typeof event.target.parentElement.href !== 'undefined') {
    $('#popupModal').fadeOut(100);
    return false;
    }
    

    But scrollbars of the window is still hidden.
    How to fix?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter steplab

    (@steplab)

    I resolved adding this to popup-modal.js:

    
    function popupClick(event) {
    if (typeof event.target.href !== 'undefined' || typeof event.target.parentElement.href !== 'undefined') {
    $('#popupModal').fadeOut(popup_modal.id==-1?0:400, function() { // Hide the popup
    									$('#popupModal').removeAttr('class');
    									$('html').removeClass('popup-modal-open');
    									if (debugPopupModal) console.log('--------------');
    									if (typeof popup_modal_admin === 'undefined') popupModal(); // Check to see if there's another popup to show during this pageview
    								});
    return false;
    							}
    
    Thread Starter steplab

    (@steplab)

    Inside function popupClick after return false; added this:

    
    function popupClick(event) {
    if (typeof event.target.href !== 'undefined' || typeof event.target.parentElement.href !== 'undefined') {
    $('#popupModal').fadeOut(popup_modal.id==-1?0:400, function() { // Hide the popup
    									$('#popupModal').removeAttr('class');
    									$('html').removeClass('popup-modal-open');
    									if (debugPopupModal) console.log('--------------');
    									if (typeof popup_modal_admin === 'undefined') popupModal(); // Check to see if there's another popup to show during this pageview
    								});
    $('body').css('overflow', 'auto !important');
    $('html.popup-modal-open body').css('overflow', 'auto !important');
    $('html.popup-modal-open').css('overflow', 'auto !important');
    return false;
    }
    
    Plugin Author Tim Eckel

    (@teckel)

    You must be using target="_blank" which is on the list to be deprecated and is considered bad UX practice. I never do that so the link opens in the same tab so it’s a non-issue. However, I know people are still incorrectly using target="_blank" (much to the dismay of their users). Using target="_blank" takes control away from the user to decide if they want to open in a new tab or not. Users know how to open something in a new tab, so they should decide. Also, using target="_blank" causes further confusion as the “back” button doesn’t work.

    In any case, I made some modifications so it will work and it’s released in version 2.0. However, I would HIGHLY suggest not using target="_blank" as it’s very frustrating to your visitors.

    • This reply was modified 8 years, 2 months ago by Tim Eckel.
    • This reply was modified 8 years, 2 months ago by Tim Eckel.
    Plugin Author Tim Eckel

    (@teckel)

    Fixed in version 2.0.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hidden scrollbar after link in the popup’ is closed to new replies.