Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have stumbled upon this type of problem myself. It seems that the bind events and the initializer events are not the same thing, go figure, and you cannot trigger the initializer events. For instance, Binding to 'resizecreate' should work, but will not be the same function as you defined in the 'create' function of the initializer.</p> <p>Try defining your events like so:</p> <pre><code>//This should define all your events $('.selector').resizeable().bind({ resizecreate : function(event,ui) {...}, resizestart : function(event,ui) {...}, resize : function(event,ui) {...}, resizestop : function(event,ui) {...}, }); </code></pre> <p>You should be able to trigger these events like:</p> <pre><code>//You can trigger the events by doing: $('.selector').trigger('resizecreate'); $('.selector').trigger('resizestart'); $('.selector').trigger('resize'); $('.selector').trigger('resizestop'); </code></pre> <p>Also note that the callbacks will fire when you operate the widget (i.e. resizing the container) as normal when defining the event callbacks with the bind method.</p> <p><strong>EDIT</strong>: Ok, I think I solved it, or at least this worked for me. Since the resizecreate event only fires when the resizeable widget is created, you must bind to it before you create the widget.</p> <p>The following example defines a resizeable widget and will fire two alerts: one from the bind definition, one from the initializer.</p> <p>HTML </p> <pre><code>&lt;div id="resizable" class="ui-widget-content"&gt; &lt;h3 class="ui-widget-header"&gt;Resizable&lt;/h3&gt; &lt;/div&gt; </code></pre> <p>JavaScript</p> <pre><code>$(function() { $( "#resizable" ).bind('resizecreate',function() { alert('BIND'); }).resizable({ 'create' : function() { alert('INITIALIZER'); } }); }); </code></pre> <p>Also note, calling <code>$('#resizable').trigger('resizecreate');</code> will fire the callback provided to the bind function as noted before (in this case, an alert box with 'BIND').</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload