hi all,
I have a resize event and handler function bound to the browser window. However, i still need to initially fire only that specific handler. The handler works correctly when triggered by the .resize event but not when i fire it on its own.
- var AutoPositionForm = function (event){
- var grid = event.data.grid;
- var collision = event.data.collision;
- $(grid).position({my:'center', at:'center', of:window, collision: collision});
- };
- var EditEventASF = function(formid) {
- var grid = formid.selector.replace('FrmGrid_','editmod');
- // keep dialog positioned per handler specs when browser window gets resized.
- $(window).unbind('resize',AutoPositionForm);
- $(window).resize({grid:grid,collision:collision},AutoPositionForm);
- // set dialog positioned per handler specs after dialog opens.
- AutoPositionForm({grid:grid,collision:collision});
- }
I can't seem to get the handler to fire when calling it on its own without error. I keep getting the "event.data is undefined" error.
- AutoPositionForm({grid:grid,collision:collision});
I assume i'm not constructing the handler function parameter correctly.
thanks.