mirror of
https://github.com/wahyd4/junv-blog.git
synced 2026-08-09 13:06:27 +10:00
18 lines
639 B
HTML
18 lines
639 B
HTML
<script src="{{ root_url }}/javascripts/jquery.fancybox.pack.js"></script>
|
|
<script type="text/javascript">
|
|
(function($){
|
|
$('.entry-content').each(function(i){
|
|
var _i = i;
|
|
$(this).find('img').each(function(){
|
|
var alt = $(this).attr('alt');
|
|
|
|
if (alt == '' || typeof alt == 'undefined'){
|
|
$(this).wrap('<a href="'+$(this).attr('src')+'" class="fancybox" rel="gallery'+_i+'" />');
|
|
} else {
|
|
$(this).after('<span class="caption">'+alt+'</span>').wrap('<a href="'+$(this).attr('src')+'" class="fancybox" title="'+alt+'" rel="gallery'+_i+'" />');
|
|
}
|
|
});
|
|
});
|
|
$('.fancybox').fancybox();
|
|
})(jQuery);
|
|
</script> |