makeClipping

makeClipping(element) -> HTMLElement

Simulates the poorly supported CSS clip property by setting element's overflow value to 'hidden'. Returns element.

To undo clipping, use Element.undoClipping.

The visible area is determined by element's width and height.

Example


<div id="framer">
  <img src="/assets/2007/1/14/chairs.jpg" alt="example" />
</div>

$('framer').makeClipping().setStyle({width: '100px', height: '100px'});
// -> HTMLElement

Click me to try it out.

example