ui.jquery resizable.bind not working?

ui.jquery resizable.bind not working?

Hi! I have tried to use the bind for resizable() ui but the web browser says size is null or not an object.
This is my code:
  1. $("#templateArea1").resizable().bind("resize", {widthId: "#area1Width", heightId: "#area1Height"}, showHW);
  2. function showHW (event, ui) {               
                    $(event.data.widthId).val(ui.size.width);
                    $(event.data.heightId).val(ui.size.height);
                }



But when I use the code below, it is working:

  1. $("#templateArea1").resizable({resize : function (event, ui) {
  2.              $("#area1Width").val(ui.size.width);
  3.              $("#area1Height").val(ui.size.height);
  4. }});
Is it a jquery bug or is it my code?