Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:15:50+00:00 2026-06-14T14:15:50+00:00

I am using Resizable Jquery UI Plugin. I have a contenteditable div inside the

  • 0

I am using Resizable Jquery UI Plugin. I have a contenteditable div inside the resizable element.

I want the fontsize of the contenteditable div to incresase when i do a increased resize and to decrease the fontsize when i do decreased resize. Basically i want the text to best fit the contenteditable div upon resizing.

Check this jsfiddle

Code :

$(".resizeable").resizable({
                containment: "#background",
                minHeight:   120,
                maxHeight:   350,
                maxWidth:    550,
                minWidth:    220,
                resize: function(event, ui) {
                    resizeText(1);
                }
            });

            function resizeText(multiplier) {
                var textarea = $("#message"); 
                var fs = (parseFloat(textarea.css('font-size')) + multiplier).toString() + 'px';    // Increment fontsize
                var text = textarea.val();                                                          // Firefox won't clone val() content (wierd..)
                textarea.css({'font-size':fs}).replaceWith( textarea.clone().val(text) );           // Replace textarea w/ clone of itself to overcome line-height bug in IE
            }

When i increase the size the ‘Enter Message’ font-size is increasing. But when i decrease its not decreasing. How can i achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:15:51+00:00Added an answer on June 14, 2026 at 2:15 pm

    This widget has an events named resize. You could listen for this event and achieve what you want.

    eg:

    $("#contenteditable").resizable({
      resize: function(event, ui) {
        // handle fontsize here
        console.log(ui.size); // gives you the current size of the div
        var size = ui.size;
        // something like this change the values according to your requirements
        $(this).css("font-size", (size.width * size.height)/1000 + "px"); 
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this jQuery plugin: http://api.jquery.com/slideToggle/ I have this code: <div id=panel><form action=postit.php
I have a div I've made resizable using jQuery UI. It works fine, but
i'm trying to create resizable div element and i'm using jQuery. This is my
I have a div that is made resizable using jQuery UI. How can I
I am using the resizable() function from jQuery to resize a div which contains
I am using the Jquery UI resizable plugin. When a resize occurs I update
I'm using jQuery UI's resizable function to resize a div containing an image. On
I am going to using jQuery UI.Layout Plug-in with JQuery UI resizable plugin. the
Using jQuery 1.4.4. When a user mouses over the table element below, I want
I'm using Jquery UI to allow the user to resize a div with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.