Tagged: x
-
AuthorPosts
-
May 13, 2016 at 7:11 am #989597
isearchlocalParticipantHi guys again…..
sorry to bother you all.
I use this JS below to make the feature box image clickable. It works a treat except one little thing.
It always opens the link on a new tab. I would like to make it so it opens on the same – basically not opening up a new tab.
Any ideas please?? thank youjQuery(document).ready(function($) {
$(‘.x-feature-box’).each(function() {
var self = $(this),
icon_href = self.find(‘.x-feature-box-text a:last-child’).attr(‘href’);
if ( icon_href.length > 0) {
$(self).find(‘.x-feature-box-graphic-inner > *’).wrap(function() {
return ‘‘;
});
}
});
});May 13, 2016 at 8:56 am #989714
JoaoModeratorHi There,
Can you check if the option Open link in New Window inside the Feature Box Element in Cornerstone is not turnned on?
If it is not please provide the URL of your website so we can have a better look.
Thanks,
Joao
May 13, 2016 at 5:41 pm #990415
isearchlocalParticipanthi yes all the options are set to no.
when i click the texts it doesn’t open a new tab, however when i click the images it does.
it must be somewhere in the above code??May 13, 2016 at 11:17 pm #990827
FriechModeratorHi There,
Please provide us your site URL so we can take a closer look.
Thanks.
May 17, 2016 at 3:04 am #995082
isearchlocalParticipantThis reply has been marked as private.May 17, 2016 at 3:26 am #995098
ChristopherModeratorHi there,
Please add this JS as well:
jQuery(".x-feature-box-graphic-inner a").attr("target","_parent");Hope it helps.
May 17, 2016 at 4:24 am #995143
isearchlocalParticipantsorry no, didnt work this is the JS code in full now
jQuery(document).ready(function($) {
$(‘.x-feature-box’).each(function() {
var self = $(this),
icon_href = self.find(‘.x-feature-box-text a:last-child’).attr(‘href’);
if ( icon_href.length > 0) {
$(self).find(‘.x-feature-box-graphic-inner > *’).wrap(function() {
return ‘‘;
});
}
});
});jQuery(“.x-feature-box-graphic-inner a”).attr(“target”,”_parent”);
May 17, 2016 at 5:40 am #995206
ChristopherModeratorHi there,
If you are using cache plugin, please clear cache.
Would you please provide us with login credentials so we can take a closer look?Thanks.
May 17, 2016 at 6:52 am #995265
isearchlocalParticipantThis reply has been marked as private.May 17, 2016 at 7:31 am #995313
JoaoModeratorThis reply has been marked as private.May 17, 2016 at 7:58 am #995339
isearchlocalParticipantThis reply has been marked as private.May 17, 2016 at 8:57 am #995446
ChristopherModeratorHi there,
Please remove the code I recommended in previous replay and update this code :
jQuery(document).ready(function($) { $('.x-feature-box').each(function() { var self = $(this), icon_href = self.find('.x-feature-box-text a:last-child').attr('href'); if ( icon_href.length > 0) { $(self).find('.x-feature-box-graphic-inner > *').wrap(function() { return '<a href="' + icon_href + '" target="_blank"></a>'; }); } }); });To :
jQuery(document).ready(function($) { $('.x-feature-box').each(function() { var self = $(this), icon_href = self.find('.x-feature-box-text a:last-child').attr('href'); if ( icon_href.length > 0) { $(self).find('.x-feature-box-graphic-inner > *').wrap(function() { return '<a href="' + icon_href + '" target="_parent"></a>'; }); } }); });Hope it helps.
May 17, 2016 at 9:46 am #995520
isearchlocalParticipantABSOLUTELY AMAZING!!
thank you Christopher.
May 17, 2016 at 10:59 am #995708
RahulModeratorYou’re welcome!
July 18, 2016 at 3:20 pm #1092393
[email protected]ParticipantThis is great. Thank you team for providing this JS code.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-989597 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
