how can i resize font of div by resizing the div using jQuery?

Posted by chirag on Stack Overflow See other posts from Stack Overflow or by chirag
Published on 2010-01-19T09:14:04Z Indexed on 2010/06/02 6:43 UTC
Read the original article Hit count: 167

Filed under:
|
|

Hello every one can any one help me out please? by using this code my font size is go beyound the size of parent div

here

$(divid).resizable({
            maxHeight: parseInt(200),
            maxWidth: parseInt(180),
            resize: function(event, ui) {

                var width1 = parseInt(ui.element.css('width'));
                var height1 = parseInt(ui.element.css('height'));

                ui.element.css({'font-size': width1+'px'});
                ui.element.css({'line-height': height1+'px'});
            }
});

where 'divid' is parent div where child div is present to fire resizing event of font, but i don't want font size go beyond the parent div, text is also not hidden..

can you please help me out???

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery