Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #737923

    Hi there, I’ve created and essential grid and it looks great. I’m trying to add a bit more styling to the lightbox area by adding links, buttons, etc to the essential grid post area but no matter what I do, I can’t get the actual links to work. I click on the links and nothing happens. Attached is a screenshot of the lightbox and its code. Do you know what could be causing this issue? thank you.

    Url: http://rideswith.wpengine.com/ (not currently live – let me know if you need login access)
    X theme Version 4.3.0
    essential grid 2.0.9.1
    wordpress 4.4.1

    #738232

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

    #741014
    This reply has been marked as private.
    #741462

    Nabeel A
    Moderator

    Hi there,

    Thank you for providing the credentials, To fix the issue please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Javascript

    jQuery(document).ready(function($){
    	$('.esgbox-opened a').click(function(){
    		var URL = $(this).attr('href');
    		window.location.href = URL;
    	});
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #742673

    Hi! I followed your instructions and unfortunately, the links still do not work.

    #743022

    the link is contained within some ajax content that is being loaded within the popup box, as such the element (esgbox-opened) is not loaded to the page- on page load and as such the jquery can’t call that element to open the link.

    #743139

    Nabeel A
    Moderator

    Hi again,

    Please replace the previous code with this one:

    jQuery(document).ready(function($){
    	$('.eg-ajax-a-button').click(function(){
    		$(document).ajaxSuccess(function() {
    			$('.esgbox-opened a').click(function(){
    				var URL = $(this).attr('href');
    				window.location.href = URL;
    			});
    		});
    	});
    });

    Don’t forget to clear your browser’s cache after adding the code.

    Cheers!

    #744409

    Hey there, thanks so much! this code worked except even though I have target=”_blank” on the href the links open in the same window. Is there a way to fix that? I know that sometimes browsers don’t honor target= but maybe there’s a way to do it via js?

    #744463

    I got a little help from my coworker. He had me replace

    window.location.href = URL;

    with

    window.open(URL,”_blank”);

    and it worked! the links open in a new window.

    Thanks again for your help.

    #744603

    Nabeel A
    Moderator

    Glad we could help!

    Cheers!

    #746517

    Okay, weird thing is happening. With the new jquery code, when I use the(X) in the top right corner to close out of the lightbox, it will open 1 or sometimes several bank windows. Even though we want the links to open in new browsers, we’d like if closing the lightbox didn’t create unnecessary blank browser windows. Would you know how to fix that? Right now our options are 1) have links open in same browser window but (X) works correctly. Or 2) links open in separate window but (X) behaves funny.

    Thanks!

    #746775

    Lely
    Moderator

    Hello There,

    Please add class to your button like btn-blank-window.
    Then update above javascript to this:

    jQuery(document).ready(function($){
    	$('.eg-ajax-a-button').click(function(){
    		$(document).ajaxSuccess(function() {
    			$('.esgbox-opened a.btn-blank-window').click(function(){
    				var URL = $(this).attr('href');
    				window.location.href = URL;
    			});
    		});
    	});
    });
    

    Hope this helps.

    #757433

    Hi there,

    I gave this a try and while the using the(X) in the top right corner to close out of the lightbox didn’t create any additional blank browser windows, the links didn’t in fact open in a new window.

    Do you have any more suggestions or are we at the point where we have to choose between weird blank windows & links opening in a separate window or having our links open in the same window?

    Thank you!
    Nout

    #758172

    Rue Nel
    Moderator

    Hello Nout,

    Please try to use this JS code instead:

    jQuery(document).ready(function($){
    	$('.eg-ajax-a-button').click(function(){
    		$(document).ajaxSuccess(function() {
    			$('.esgbox-opened a.btn-blank-window').click(function(){
    				var URL = $(this).attr('href');
    				window.open(URL);
    			});
    		});
    	});
    });

    Hope this helps.

    #759314

    I’ve been testing this most of the morning and I feel like it’s almost there.

    The good news:
    The links open in a new window.

    The bad news:
    With every subsequent link click, more windows are opened. For example:
    Lightbox #1: click on button – opens 1 new browser window
    Lightbox #2: click on button – opens 2 new browser windows
    Lightbox #3: click on button – opens 3 new browser windows
    And so on…

    When I clear cookies, the number is reset back to 1 window. I’m hoping there’s an easy fix for this. What do you think?

    Thanks,
    Nout