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?

Turning off Fancy Lightbox for certain links
(1 viewing) (1) Guest
"ARI Fancy Lightbox" WordPress plugin
Go to bottomPage: 1
TOPIC: Turning off Fancy Lightbox for certain links
#65774
Turning off Fancy Lightbox for certain links 4 Years, 5 Months ago Karma: 0
In post #65335 ARI support offered a couple of code examples for turning off Lightbox for certain types of links. One was:
-----Open "ARI Fancy Lightbox -> Settings -> Advanced" page and populate "Custom JS code" parameter with the following code:

Code:

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');
}
});


It will ignore links for google.com and yahoo.com sites. You can populate ignoreSites variable with your domains.-----

Another dealt with turning off links with the "www" string in the url. The response fro ARI Soft for this was:
----The code doesn't work because links on the page contains www. prefix, but it is not specified in ignoreSites variable. You can use the following code to ignore links with or without "www." prefix:

Code:

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

Could you please provide the code that I could add if I wanted to turn off Lightbox for links to local pdf files that contain the "#page=" string in the url?

Apologies for this additional request, but I am not skilled in JS.
Thank you!
The administrator has disabled public write access.
 
#65777
Re:Turning off Fancy Lightbox for certain links 4 Years, 5 Months ago Karma: 748
Hello,

Try the following code:

Code:


$('a[href]').each(function() {
  var $a = $(this), link = $a.attr('href');
  if (link.indexOf('#page=') !== -1) {
    $a.addClass('no-lightbox');
  }
});



Regards,
ARI Soft
The administrator has disabled public write access.
 
#65787
Re:Turning off Fancy Lightbox for certain links 4 Years, 5 Months ago Karma: 0
Works great, thank you!
The administrator has disabled public write access.
 
Go to topPage: 1