jQSlickWrap
jQSlickWrap implementiert als jQuery Plugin den Sliced and Diced Sandbags Ansatz von A List Apart.
jQSlickWrap is a plugin for jQuery which enables you to easily and accurately wrap your text around the content of floated images.
Und so funktioniert es:
- If necessary, pre-load the image.
- Determine the CSS styles for the image (float and padding).
- Create a <canvas></canvas> element and set its dimensions to the size of the image plus its padding.
- Draw the image onto the canvas in the top-left location.
- Figure out the “background” color of the image by examining the pixel data at the top-left corner of the image.
- Fill the <canvas></canvas> with this background color.
- Re-draw the image contents onto the <canvas></canvas>, but now in the correct location as specified by its padding.
- Iterate through the image to find the “edge” of the image’s contents at each row - save this width. (the size of a row is defined to be the resolution in the settings to a call to slickWrap).
- Using the widths collected in the previous step, generate <div></div> elements of those sizes.
- Float the <div></div>s to the correct side, and set their clear style to the same side.
- Set the background-image to a non-repeating image described by a call to canvas.toDataURL() for the original’s containing element.
- Hide the original image.

