Created
February 8, 2014 14:14
-
-
Save hudidit/8884374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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