BACKBONE {BLOG}

Quote
We love technology, good ideas and Whisky

jQuery Plugin : CJ Object Scaler
BLOG POST - DETAIL PAGE

jQuery Plugin : CJ Object Scaler

November 09, 2011
jQuery Plugin : CJ Object Scaler

A Cool jQuery Plugin that helps you to resize massive image

Here is the plugin description from official CJ Object Scaler Web site:

CJ Object Scaler will scale an object to either fit or fill within the boundaries of a destination object. I based this plug-in off another JavaScript project I made awhile back, you can read what it does in the CJ Image: Easily Calculate Image Scaling blog enry. It was a nice little function that would help you calculate the size and offsets to use when scaling an image to fit (or fill) within another element. It didn't actually do any scaling, per say, it merely provided you with the numeric amounts to use.

Why do we need a jQuery Image resizing plugin

When it comes to online store web development, you will have product images in different ratios and sizes. It's hard to make them all pretty unless you do some tricks. CJ Object Scaler is the plugin to help you out.

Demo

Before

  • img01
  • img03
  • img04

After (fit)

  • img01
  • img03
  • img04

After (fill)

  • img01
  • img03
  • img04

jQuery Code

$("#fill img").each(function()
{
  $(this).cjObjectScaler(
  {
    method: "fill",
    fade: 1000
  });
});

More details

You can see demo and download the plugin from the official website

Backbone Social Media Links