Can't get resize event handler to work.....
I have a dialog that is resizable. I added a resize() event handler but for some reason it doesn't run when I resize the dialog. I put a breakpoint in the resize function (the line where I put the breakpoint is highlighted in the code below). But when I resize the dialog, the breakpoint never stops.
Can someone help me figure out why?
- $(document).ready(function() {
rows = new Array();
dialog = $("#addRecordDialog").dialog({
title:"Add Record",
autoOpen: false,
modal: true
})
- var rtime;
var timeout = false;
var delta = 200;
$('#addRecordDialog').resize(function() {
rtime = new Date();
if (timeout === false) {
timeout = true;
setTimeout(resizeend, delta);
}
});
function resizeend() {
if (new Date() - rtime < delta) {
setTimeout(resizeend, delta);
} else {
timeout = false;
alert('Done resizing');
}
}
- });