views:

233

answers:

1

I'm trying to use jWYSIWYG and autoGrow together so that the textarea in the jWYSIWYG editor expands as you type. Either jWYSIWYG works or autoGrow works, but not both together. I'm pretty new to jQuery, so would appreciate hearing what I'm doing wrong here.

  <script type="text/javascript">
  $(function(){
    $('#wysiwyg').autoGrow();
  });

  $(function()
    {
      $('#wysiwyg').wysiwyg();
  });
  </script>
  <script type="text/javascript">
</script>
</head>

<body>
  <h1>jWYSIWYG</h1>
  <h2>Example: Basic</h2>
  <div>
    <textarea name="wysiwyg" id="wysiwyg" rows="5" cols="40" style="overflow: hidden; height: auto; width: 350px"></textarea>
+1  A: 

Hi Josh and hi everyone, I am the author of the Autogrow plugin. ;-) Well, Marko is right here. This is a case of conflicting scripts. Both plugins are using the same events.

The thing to do in this case would be to merge the two scripts (contact the authors first), but this can be quite a challenge.

Jevin O. Sewaruth
Jevin, thanks for answering.I'd love if you'd be able to see whether you can merge your plugin with jWYSIWYG. I'm simply too new to jQuery to work that kind of magic myself. Maybe in a few weeks I'll try tackling it again.I think Autogrow would work great with the jWYSIWYG plugin. I raised the issue on jWYSIWYG's git http://github.com/akzhan/jwysiwyg/issues#issue/21. But it'd be fantastic if you could work something out yourself. Let me know what you think.
Josh Smith
Jevin, maybe it's just an aesthetic thing for me, but I've also noticed that autoGrow looks better if you're using `onkeyup` or `onkeypress` rather than `onkeydown`.
Josh Smith