-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblogEntryTopper.js
More file actions
25 lines (20 loc) · 801 Bytes
/
blogEntryTopper.js
File metadata and controls
25 lines (20 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
-=-= BLOG ENTRY TOPPER =-=-
DESCRIPTION: Handles the blog entry topper images.
Finds image in blog entries with an ALT tag of 'blogEntryTopper'
and then moves image to the top of the entry. The CSS
autosizes the image to fit the blog entry's width.
AUTHOR: Adam Shiver
VERSION: 1.0
DATE: May 9, 2011
*/
$(document).ready(function($){
blogEntryTopperImg = $('.blog-entry img[alt^=blogEntryTopper]');
blogEntryTopperImg.hide();
blogEntryTopperImg.each(function() {
/* Applies special class to the image */
$(this).addClass('blogEntryTopperImg');
/* Moves topper image to the top of the blog entry and wraps it in a div with a class of blogEntryTopper_wrapper */
$(this).prependTo($(this).parent().parent()).show().wrap('<div class="blogEntryTopper_wrapper" />');
});
});