Skip to content

Commit 16aff88

Browse files
author
ppoffice
committed
feat: add support for inline images
1 parent 4cceb55 commit 16aff88

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

source/css/_partial/article.styl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@
7979
img, video
8080
max-width: 100%
8181
height: auto
82-
display: block
8382
margin: auto
83+
vertical-align: text-bottom
84+
video
85+
a img
86+
display: block
8487
iframe
8588
border: none
8689
table

source/js/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
var toTop = ($('#sidebar').height() - $(window).height()) + 60;
33
// Caption
44
$('.article-entry').each(function(i) {
5-
$(this).find('img').each(function() {
5+
$(this).find('img').filter(function (element) {
6+
return $(this).hasClass('');
7+
}).each(function() {
8+
// add image caption
69
if (this.alt && !(!!$.prototype.justifiedGallery && $(this).parent('.justified-gallery').length)) {
710
$(this).after('<span class="caption">' + this.alt + '</span>');
811
}
912

10-
// 对于已经包含在链接内的图片不适用lightGallery
1113
if ($(this).parent().prop("tagName") !== 'A') {
1214
$(this).wrap('<a href="' + ($(this).attr("data-imgbig") ? $(this).attr("data-imgbig") : this.src) + '" title="' + this.alt + '" class="gallery-item"></a>');
1315
}

0 commit comments

Comments
 (0)