Reputation: 1507
I'm using the jQuery UI resize function, and when user is finished with the operation I'd like it to run this code:
var pl=$('#player iframe')[0];pl.src=pl.src;
Would a callback work? How would I insert it into the resize function?
Specifically, the code I'm using for resize is this:
$(function() {
$( ".resizableaspect" ).resizable({
aspectRatio: true,
helper: "ui-resizable-helper"
});
});
Upvotes: 1
Views: 256
Reputation: 35973
You are using jQueryUI I think.
This is the official documentation:
http://jqueryui.com/resizable/
The event stop
is called when you have finished to resize your element.
Other event are:
- create
- resize
- start
- stop
Try this:
$(function() {
$( ".resizableaspect" ).resizable({
aspectRatio: true,
helper: "ui-resizable-helper",
stop: function(e, ui) {
var pl=$('#player iframe')[0];pl.src=pl.src;
}
});
});
Upvotes: 2
Reputation: 78710
resizable
has an event called stop
, which is "triggered at the end of the resize operation".
http://api.jqueryui.com/resizable/
$( ".resizableaspect" ).resizable({
aspectRatio: true,
helper: "ui-resizable-helper",
stop: function(){
// YOUR CODE HERE
}
});
Upvotes: 2