March 8, 2012

resizable on text area element not working

Question by Goldy

i have started to learning Jquery and i can’t activate the resizable function.
i downloaded the core Jquery and the UI.

all working well, the animate,scroll,effects and more

BUT the resizable functions kinda stack and i have no idea why.
i have been marked the resizable pack and check if the UI have it and its have.

i try to activate it in safari , chrome ,ff on the latest versions .

<script type="text/javascript" src="../scripts/Jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../scripts/Jquery/jquery-ui-1.8.18.custom.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() 
    {
        /*not working , we need to check why its not readable.*/
        $('p').resizable('enable');

        $('textarea').resizable({
            handles: "se",
            grid : [20, 20],
            minWidth :153,
            minHeight :100,
            maxHeight :200,
            containment: 'parent'
        });
    });
</script>

Answer by Ngalam City

if you’ve loaded all ??

try it :

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text/css">
    #resizable { width: 100px; height: 100px; background: silver; }
  </style>
  <script>
  $(document).ready(function() {
    $("#resizable").resizable();
  });
  </script>
</head>
<body style="font-size:62.5%;">

<div id="resizable"></div>

</body>
</html>

Answer by Starx

Where is your handles? Try to see if this works

  $('textarea').resizable({
  handles: "se",
  grid : [20, 20],
  minWidth :153,
  minHeight :100,
  maxHeight :200,
  containment: 'parent'
  });

Here is a demo of your code working. Be sure to include the CSS File, in order to see the handle.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!