JamesBB on "[Plugin: jQuery Colorbox] Stop displaying full javascript code in page source"
June 13, 2010 by David Olsen
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, http://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, http://www.techotronic.de/ –>
Thank you!
Jamy
http://wordpress.org/extend/plugins/jquery-colorbox/
Related posts:
- Phuong1981 on "[Plugin: jQuery Colorbox] Plugin not working properly on Chrome" The problem occurs on pages plugin (demo page) and on...
- PixelUlu on "jQuery Mouseover Fade Issue" Here is a snippet from my header in the <head>...
- jamesmehorter on "[Plugin: Events Calendar] Do not update! 12-12-09" Hi All, I’m having some issues with the SideBar implementation....
- delocurr on "[Plugin: WP jQuery Lightbox] How to activate slideshow" I could use some help please. I left the settings...
- jonnyplow on "disable link for drop down" jho1086, in addition to yours, which works great, I added...
Related posts brought to you by Yet Another Related Posts Plugin.






Comments
Facebook comments:
Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!