4 ms·
Ask HN: Review my jQuery Plugin (jQSlickWrap)
Over the course of the past week I designed and wrote a plugin for jQuery which provides a client-side implementation of the "Sandbag" approach to getting text/content to wrap around the actual contents of a floated image (as opposed to the typical bounding box you are usually stuck with).
- pbhjpbhj 17y agonice, like the reflect plugin too (but it could use a spacing option for "hovering" images above the reflection)
- JasonWyatt 17y agoGood idea, thanks!
- zackham 17y agoThis looks great, will be using it. If I run into anything I'll let you know. Am I safe in assuming that if canvas is not supported it just does around-the-image wrapping?
- JasonWyatt 17y agoThat's right, it checks for canvas before it tries to do anything. If you find any bugs or have requests, the google code page where you download it from has an issue tracker. Glad you like it!
- woid 17y agoa great idea Jason! It is great for dynamic images, but I would think 99% of use cases is for static image. I would appreciate feature which does the magic and enables me to render static piece of HTML+CSS for direct replacement. This way I would be able to bake static version during development and publish it without dependency on canvas or other tricky methods.
- mnemonik 17y agoHere is a similar tool that outputs static html/css: http://www.csstextwrap.com/ http://www.csstextwrap.com/ EDIT: It seems that this plugin falls back on the normal css float property, so the only downsides I see are that JS is required and there is some small bandwidth overhead of sending the script. Not very big downsides at all.
- armandososa 17y agoThis is completely awesome. I'd like somekind of 'cache' too, so all the calculation only executes once.
- pierrefar 17y agoWouldn't this "pre-calculated" version work only for a certain combination of text size, line-height, element widths, and zoom settings? A pre-calculated version is not much different (conceptually) from just creating a static image containing the image and the text.
- Tichy 17y agoHaven't read all the technical details, but if the idea is to "sandbag" the image, text of all sizes and fonts should be able to flow around it properly? All it does is to create shape out of divs that is a closer match to the visible pixels than a rectangle.
- jimmybot 17y agoI think what's really cool about this is that it looks like a really helpful tool for breaking the boxy, straight-line feel of nested elements and display:block that is normally the natural state of web page design. Props.
- PanMan 17y agoQuite like the idea, and the execution seems simple enough. What I would add to your site tho, are examples of the actual examples :). Now your examples are just code, while it would be nice to see them. Either next to the code, or with tabs, or... You get the idea. Kind of how the jQuery site does it.