From 98d52c7c03e78c98cf2daa9729824e8752f8cb2a Mon Sep 17 00:00:00 2001 From: SkyArrow Date: Wed, 25 Jan 2012 01:15:25 +0800 Subject: picture caption --- sass/parts/_article.scss | 7 +++++++ source/_includes/custom/after_footer.html | 1 + source/images/caption.png | Bin 0 -> 1266 bytes source/javascripts/caption.js | 9 +++++++++ 4 files changed, 17 insertions(+) create mode 100644 source/images/caption.png create mode 100644 source/javascripts/caption.js diff --git a/sass/parts/_article.scss b/sass/parts/_article.scss index 6d880ce..09555f4 100644 --- a/sass/parts/_article.scss +++ b/sass/parts/_article.scss @@ -59,6 +59,13 @@ article{ img{ max-width: 100%; height: auto; + & + .caption{ + background: image-url('caption.png') 0 4px no-repeat; + display: block; + font-size: 12px; + color: #999; + padding-left: 25px; + } } blockquote{ background: $border; diff --git a/source/_includes/custom/after_footer.html b/source/_includes/custom/after_footer.html index 7796caf..059b593 100644 --- a/source/_includes/custom/after_footer.html +++ b/source/_includes/custom/after_footer.html @@ -1,3 +1,4 @@ + \ No newline at end of file diff --git a/source/images/caption.png b/source/images/caption.png new file mode 100644 index 0000000..33e073a Binary files /dev/null and b/source/images/caption.png differ diff --git a/source/javascripts/caption.js b/source/javascripts/caption.js new file mode 100644 index 0000000..271c428 --- /dev/null +++ b/source/javascripts/caption.js @@ -0,0 +1,9 @@ +(function($){ + $('.entry img').each(function(){ + var alt = $(this).attr('alt'); + + if (alt != ''){ + $(this).after(''+alt+''); + } + }); +})(jQuery); \ No newline at end of file -- cgit v1.1-2-g2b99