-
AuthorPosts
-
January 8, 2016 at 4:01 pm #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.1January 8, 2016 at 10:37 pm #738232Hello 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 / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
January 11, 2016 at 10:50 am #741014This reply has been marked as private.January 11, 2016 at 4:55 pm #741462Hi 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!
January 12, 2016 at 10:15 am #742673Hi! I followed your instructions and unfortunately, the links still do not work.
January 12, 2016 at 1:45 pm #743022the 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.
January 12, 2016 at 3:06 pm #743139Hi 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!
January 13, 2016 at 10:05 am #744409Hey 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?
January 13, 2016 at 10:39 am #744463I 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.
January 13, 2016 at 12:13 pm #744603Glad we could help!
Cheers!
January 14, 2016 at 4:21 pm #746517Okay, 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!
January 14, 2016 at 8:04 pm #746775Hello 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.
January 21, 2016 at 1:47 pm #757433Hi 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!
NoutJanuary 21, 2016 at 10:07 pm #758172Hello 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.
January 22, 2016 at 11:33 am #759314I’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 -
AuthorPosts