Tagged: x
-
AuthorPosts
-
February 2, 2017 at 3:09 pm #1355724
Hey!
I’m using the content dock plugin and was trying to have the link open a new window (see screenshot). There isn’t an option for this. Any workaround? Thanks.
February 2, 2017 at 9:26 pm #1356207Hi There,
Thanks for writing in.
You could use this script below to wrap the button of your link with a target blank so that it will open in a new tab.
Add this code in your customizer > custom > JS:
jQuery(document).ready(function($){ $('.classofyourcontentdockbutton').each(function(){ $(this).attr('target', '_blank' ); }); });
Hope it helps.
Let us know how it goes.
Thanks.
February 3, 2017 at 8:42 am #1356777Awesome, thanks! If you could add this as a feature request for the content dock it would be greatly appreciated! Thanks 🙂
February 3, 2017 at 8:48 am #1356786Also, how do I give my content dock a class? I don’t see an option to do that on the admin side
February 3, 2017 at 3:14 pm #1357231Hi There,
You could tweak the given JS code a little bit to this:
jQuery(document).ready(function($){ $('.classofyourcontentdockbutton').each(function(){ $(this).attr('target', '_blank' ); }); $( ".x-content-dock" ).addClass( "yourClass" ); });
Or you could use the default class of content dock.
x-content-dock
Thanks.
March 23, 2017 at 2:58 pm #1418132For some reason it isnt working… I used this code:
jQuery(document).ready(function($){
$(‘.x-content-dock’).each(function(){
$(this).attr(‘target’, ‘_blank’ );
});
});On this page
https://glassjacobson2.wpengine.com/
If you scroll down half way the Broker Check image pops up. Any help to make it work?
Thanks
March 23, 2017 at 11:46 pm #1418621Hi there,
It’s wrong, please change it to this
jQuery(document).ready(function($){ /* open the link in new window */ $('.x-content-dock > a').each(function(){ $(this).attr('target', '_blank' ); }); /* add class to your content dock, "yourClass" is a sample, please add your preferred class */ $( ".x-content-dock" ).addClass( "yourClass" ); });
Thanks!
March 24, 2017 at 11:26 am #1419205Awesome that did it. Thanks!
March 24, 2017 at 11:43 am #1419231You are most welcome. 🙂
-
AuthorPosts