Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Lightbox for External Link for One Domain Only
(1 viewing) (1) Guest
"ARI Fancy Lightbox" WordPress plugin
Go to bottomPage: 1
TOPIC: Lightbox for External Link for One Domain Only
#65815
Lightbox for External Link for One Domain Only 4 Years, 5 Months ago Karma: 0
Hi,

So I see the JS Code for excluding certain external links from the lightbox:

var ignoreSites = [
'google.com',
'yahoo.com'
];
$('a[href]').each(function() {
var $a = $(this), domain = ARI_FANCYBOX_HELPER.getLinkPart($a.attr('href'));
if (ignoreSites.indexOf(domain) !== -1) {
$a.addClass('no-lightbox');
}
});

BUT, for the most part, I only want to lightbox external links for ONE domain (but it's on multiple pages). Is there a code that does the opposite of the code above?
The administrator has disabled public write access.
 
#65816
Re:Lightbox for External Link for One Domain Only 4 Years, 5 Months ago Karma: 748
Hello,

Disable attaching the lightbox to external links in plugin settings and use the following JS code to attach the lightbox for specific domain:

Code:


var allowDomains = [
  'domain.com'
];
$('a[href]').each(function() {
  var $a = $(this), domain = ARI_FANCYBOX_HELPER.getLinkPart($a.attr('href'));
  if (allowDomains.indexOf(domain) !== -1) {
    $a.removeClass('no-lightbox').addClass('ari-fancybox-iframe');
  }
});



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1