Hi, Try using Function#defer[1] to defer your onComplete logic; the browser may not be done processing the DOM changes from the update yet. Not saying that's definitely it, but it may help and is easy to try.
[1] http://prototypejs.org/api/function/defer HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 12, 3:31 pm, Mel <[email protected]> wrote: > In the following function, I am experiencing weird behavior when > trying to resize a popup window based on the size of the inserted JSP > page within this popup window page. In JSP 1 I have a list of records > which is preceded by an icon on each record. I click on the icon > image and it should open JSP 2 within JSP 1 via the DIV tags in JSP > 1. When I click on the icon the function below should execute and it > does but the functionality is not consistent depending on the size of > the window. The problem seems to exist in the ELSE section within the > IF statement. If the inserted JSP page via DIV tags, called > 'vendorInfoResults', extends in size below the outline of the popup > window and I click on the next icon of the rows displayed in the > 'vendorInfoResults' section then the window does not expand and I may > do it again a second time and then it does work. > > Are there any issues or bugs within the onComplete function that I am > using in prototype-1.6.0.2.js which is the version that I'm using? Is > there a better way to handle the window.resizeBy method? > > Any help would be greatly appreciated. I've been trying to resolve > this issue since last Friday and it's driving me nuts. > > [CODE] > function getVendorInfo(vNum) { > var url = '/common/Lookup.action'; > new Ajax.Updater('vendorInfoResults', url, > {method: 'get', > parameters: {vendorInfo: '', vendorNum: vNum}, > onComplete: function() { > var vendorWinH = > document.body.offsetHeight; > var vendorInfoH = > $('vendorInfoResults').offsetHeight; > > if (vendorWinH == winH) > window.resizeBy(0, > vendorInfoH); > else { > var newVendorWinH = winH + > vendorInfoH; > alert("newVendorWinH = " + > newVendorWinH); > alert("vendorWinH = " + > vendorWinH); > alert("winH = " + winH); > if (newVendorWinH > > vendorWinH) > window.resizeBy(0, > newVendorWinH - vendorWinH); > else if (newVendorWinH < > vendorWinH) > //window.resizeBy(0, > vendorWinH - newVendorWinH); > window.resizeBy(0, > winH - (vendorWinH + 5)); > } > } > }); > > } > > [/CODE] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
