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


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 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.


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 5 Years, 1 Month 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 5 Years, 1 Month ago Karma: 760
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 5 Years, 1 Month ago Karma: 0
Works great, thank you!
The administrator has disabled public write access.
 
Go to topPage: 1