Joe,

That is amazing. It does exactly as I want.

Btw, I think I found out my problem earlier with Chrome when making your
bookmarklet work: I wasn't even showing my bookmark bar in Chrome.

Thanks, much,


On Fri, Nov 1, 2013 at 4:48 PM, Joe Bogner <[email protected]> wrote:

> For fun I wrote a little javascript function that will find the first
> container for the selected text and will resize it.
>
> (function shrink() {
>   var sel = window.getSelection().baseNode;
>   containers = ['DIV','ARTICLE', 'TABLE'];
>   function getTopNode(node) {
>     if (node != undefined && containers.indexOf(node.nodeName) < 0) {
>       return getTopNode(node.parentNode)
>     } else {
>       return node;
>     }
>   }
>   var parent = getTopNode(sel);
>   if (parent) {
>     parent.style.width="300px";
>   }
> })()
>
> Certainly 300px is too small, but feel free to change.
>
> You can turn it into a bookmarklet using this:
>
> http://ted.mielczarek.org/code/mozilla/bookmarklet.html
>
> Just a toy but demonstrates the concept
>
>
> To use, you would select part of the text you want resized and click
> the bookmarklet. It will find that text's parent and will resize the
> parent
>
>
-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to