I have this script calling a lightbox to trigger if the URL is site.com/page.html?globe=1 and it is not working here is the code:
var $j = jQuery.noConflict();
$j(document).ready(function() {
var url = window.location.href;
url = url.toLowerCase();
if (url.indexOf('globe=1') != -1) {
$j("a#fancy").fancybox({
'padding' : 0,
'overlayShow' : false,
});
}
}
});
$j("a#fancy").fancybox({
'padding' : 0,
'overlayShow' : false,
});
What is wrong and why does it not work? I have used this before for other scripts other than fancybox and I assume I am typing some code wrong.
fancyboxfunction you're calling ifglobe=1is present in the URL?url.indexOf('globe=1')isn't fail proof. It would also trigger for?GoogleGlobe=123;