Skip to content

Instantly share code, notes, and snippets.

@hudidit
Created February 8, 2014 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hudidit/8884374 to your computer and use it in GitHub Desktop.
Save hudidit/8884374 to your computer and use it in GitHub Desktop.
;(function( window, $ ){
var dir = window.colorbox_plugin_url;
$('head').eq(0).append(
$('<link/>').attr({
rel: 'stylesheet'
,href: dir + 'colorbox/colorbox.css'
})
);
$(function(){
$('.entry p img, .entry div.wp-caption img').each(function(){
var $this = $(this);
$this.attr('title', '点击进入相册模式');
$this.parent()
.addClass('colorbox-images')
.attr('title', $this.attr('alt'));
});
$('.colorbox-images').colorbox({
rel: 'colorbox-images'
,height:'75%'
});
});
})( window, $ );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment