[Plugin: jQuery Colorbox] Stop displaying full javascript code in page source
-
Hello,
I was wondering if there is any way we can remove the following from the page source and put it in an external file?
<!– jQuery Colorbox 3.4 | by Arne Franken, https://www.techotronic.de/ –>
<script type=”text/javascript”>
// <![CDATA[
jQuery(document).ready(function($) {
$(“a:has(img):not(.colorbox-off)”).each(function(index, obj) {
if ($(obj).attr(“href”).match(/\.(?:jpe?g|gif|png|bmp)/i)) {
var $nestedElement = $(obj).children(0);
if ($nestedElement.is(“img”)) {
var $nestedElementClassAttribute = $nestedElement.attr(“class”);
var $groupId = $nestedElementClassAttribute.match(‘colorbox-[0-9]+’) || $nestedElementClassAttribute.match(‘colorbox-manual’);
if ($groupId && !$nestedElementClassAttribute.match(‘colorbox-off’)) {
$groupId = $groupId.toString();
if ($groupId == “colorbox-manual”) {
$groupId = “nofollow”;
}
$(obj).colorbox({
rel:$groupId,
title:$nestedElement.attr(“title”),
maxWidth:”95%”,maxHeight:”100%”,slideshow:true, opacity:”0.85″,
transition:”elastic”,
speed:650,
slideshowSpeed:2500,
close:”close”,
next:”next”,
previous:”previous”,
slideshowStart:”start slideshow”,
slideshowStop:”stop slideshow”,
current:”{current} of {total} images”
});
}
}
}
});
});
// ]]>
</script> <!– jQuery Colorbox 3.4 | by Arne Franken, https://www.techotronic.de/ –>Thank you!
Jamy
- The topic ‘[Plugin: jQuery Colorbox] Stop displaying full javascript code in page source’ is closed to new replies.