Stephen Woodbridge wrote:
> Mark Gibson wrote:
>> Stephen Woodbridge wrote:
>>> Mark Gibson wrote:
>>>> I've not had chance to test it, but I'm sure all elements
>>>> have a resize event. If not then the resizeable plugin can
>>>> trigger() it itself.
>>> Hi Mark,
>>>
>>> I tried to do this like this:
>>>
>>> $(document).ready(function(){
>>>      $('#resize_map').Resizeable(
>>>          {
>>>              minHeight: 100,
>>>              maxHeight: 700,
>>>              minWidth: 100,
>>>              maxWidth: 800,
>>>              handlers: {
>>>                  se: '#resize'
>>>              }
>>>          }
>>>      );
>>>      $("#resize_map").bind('resize', function(e) {
>>>          alert("resized event");
>>>      });
>>> });
>>>
>>> But no event fires :(, I have also tried:
>>>
>>>      $("#resize_map").resize(function(e) {
>>>          alert("resized event");
>>>      });
>>>
>>> $("#resize_map").trigger('resize'); does force the event to fire.
>>>
>>> I can add the trigger('resize') to the resizable plugin, but it seems 
>>> like it should just fire. Any other thoughts?
>> Steve,
>>
>> After a quick flick through JavaScript, The Definitive Guide and a
>> few online docs, it seems that the resize event only applies to
>> window size changes.
>> So you'd have to manually trigger the event.
>>
>> Also, I've noticed that trigger appears to be broken for IE in the
>> latest jquery download r501! - but is fixed in SVN.
>>
>> BTW, you can just chain the bind:
>>
>> $('#resize_map')
>>      .Resizeable({
>>          ...
>>      })
>>      .bind('resize', function(e) {
>>          alert("resized event");
>>      });
>>
> 
> Gilles, Thank you for you note about the rename in svn.
> 
> Mark,
> 
> I have made a little progress, reading the plugin and looking at the 
> demo I found that:
> 
> $(document).ready(function(){
>      $('#resize_map').Resizeable(
>          {
>              minHeight: 100,
>              maxHeight: 700,
>              minWidth: 100,
>              maxWidth: 800,
>              handlers: {
>                  se: '#resize'
>              },
>              onResize: function(size, position){
>                  console.log(size.height + 'x' + size.width + " resized");
>              },
>              onStop: function(){
>                  alert("We have finished resizing!");
>              }
>          }
>      );
> });
> 
> This will fire on every mouse move. This is very cool, but is not what I 
> want. I need just a single final event fired when the resizing is done 
> so I can update the map with its new size and have it request an new 
> image from the sever.
> 
> The code looks like it has an onStop: function(){} option but I could 
> not get that to fire.
> 
> -Steve

Nevermind! it works just great out svn, exactly the way I wanted.

-Steve

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to