Loading ...
Sorry, an error occurred while loading the content.

47215Re: [ydn-javascript] resize layout with gridcss

Expand Messages
  • Dav Glass
    Apr 1, 2009
      Rudy --

      You can just call layout.resize(); after the data has been loaded.
      That should fire your 'resize' subscriber.

      If that doesn't work, please post a link to a repro case and we will
      take a look..

      Dav

      --
      Dav Glass
      davglass@...
      blog.davglass.com


      + Windows: n. - The most successful computer virus, ever. +
      + A computer without a Microsoft operating system is like a dog
      without bricks tied to its head +
      + A Microsoft Certified Systems Engineer is to computing what a
      McDonalds Certified Food Specialist is to fine cuisine +



      On Wed, Apr 1, 2009 at 4:26 AM, rudycox2000 <rudix@...> wrote:
      > Hi, I would like to know how to resize the layout after the content of a div
      > has changed.
      >
      > I setup a layout with 3 divs , header (hd), maindiv (bd), footer (ft)
      >
      > Header and footer have fixed height
      > Maindiv height can change, less or more than default settings.
      > I wrote a function that fires just after every ajax request, but sometimes
      > fails and maindiv's content is cut (it depends on connection speed)
      > The reason is that the function is fired before all elements on the page are
      > rendered (ie.images)
      >
      > I tried to use YAHOO.util.Event.onDOMReady(resizelayout) in the 'success'
      > handler of the ajax request, but nothing changed
      >
      > Is there a way to subscribe this function on maindiv's content changing??
      >
      > function resizelayout(){
      > var wrapHeight = Dom.get('bd').offsetHeight+ Dom.get('hd').offsetHeight+
      > Dom.get('ft').offsetHeight+50;
      > //alert(wrapHeight);
      > var DocHeight=Dom.getClientHeight();
      > if(wrapHeight<DocHeight){
      > wrapHeight=Dom.getClientHeight();
      > }
      > layout.set('height', wrapHeight);
      > layout.resize(true);
      > }
      >
      > For instance this works when the browser size change
      >
      > layout.on('resize', function() {
      > var wrapHeight = Dom.get('bd').offsetHeight+ Dom.get('hd').offsetHeight+
      > Dom.get('ft').offsetHeight+50;
      > var DocHeight=Dom.getClientHeight();
      > if(wrapHeight<DocHeight){
      > wrapHeight=Dom.getClientHeight();
      > }
      > layout.set('height', wrapHeight);
      > });
      >
      > thankyou in advance for any answer
      >
      > Rudy
      >
      >
    • Show all 4 messages in this topic