Troy Forster

Musings on technology, environment and adventure

Pages

Recent posts

Tags

Categories

Navigation

Archive

Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

frameIt -- A jQuery Plugin To Frame And Centre Images

One of my colleagues is involved with an application that is required to display thumbnails that have been created and uploaded by our users.  The thumbnails come in many sizes and orientations yet still need to be displayed in a consistent fashion.  I quickly whipped up a jQuery plugin called frameIt to take care of this.  frameIt takes the supplied list of images and applies padding on a case by case basis to achieve the effect.  You can see how the following two images have been centered and framed inside a consistently sized red box.

frameIt's default settings can be overridden to allow for full control of sizing, whitespace and border styling.  An example of frameIt in use is:

$("img").frameIt({
   width: 200, 
   height: 100, 
   borderColor: "#FF0000", 
   padding: 10, 
   borderStyle: "solid", 
   borderWidth: 1 
});
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList
Posted: Mar 31 2009, 15:42 by tforster | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under:

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading