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

resize layout with gridcss

Expand Messages
  • rudycox2000
    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)
    Message 1 of 4 , Apr 1, 2009
    • 0 Attachment
      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
    • Dav Glass
      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
      Message 2 of 4 , Apr 1, 2009
      • 0 Attachment
        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
        >
        >
      • rudycox2000
        Thankyou Dav, here you can find an example that sometimes work, sometimes not. http://zonaprotetta.ch/default_test.asp Try it with a resized browser. here you
        Message 3 of 4 , Apr 2, 2009
        • 0 Attachment
          Thankyou Dav, here you can find an example that sometimes work, sometimes not. http://zonaprotetta.ch/default_test.asp

          Try it with a resized browser.
          here you can find two images of what happens
          http://www.zonaprotetta.ch/image1_Cut.jpg
          http://www.zonaprotetta.ch/image2_ok.jpg
          As you can see sometimes the maindiv content is truncated.

          All Ajax calls are made using the function CaricaPagina(div, url) in js/rudy_test.js

          the function to resize the layout (adatta();) is inside the homepage, and it is call at the end of success handler of CaricaPagina.

          I tried to call layout.resize() as you suggeted instead of adatta(), but the resize is not done.

          Thankyou
          Rudy




          --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
          >
          > 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
          > >
          > >
          >
        • Dav Glass
          I m not seeing it error, please boil this down to a reproducible case so I have something to work with.. Dav -- Dav Glass davglass@gmail.com blog.davglass.com
          Message 4 of 4 , Apr 2, 2009
          • 0 Attachment
            I'm not seeing it error, please boil this down to a reproducible case
            so I have something to work with..

            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 Thu, Apr 2, 2009 at 6:15 AM, rudycox2000 <rudix@...> wrote:
            > Thankyou Dav, here you can find an example that sometimes work, sometimes
            > not. http://zonaprotetta.ch/default_test.asp
            >
            > Try it with a resized browser.
            > here you can find two images of what happens
            > http://www.zonaprotetta.ch/image1_Cut.jpg
            > http://www.zonaprotetta.ch/image2_ok.jpg
            > As you can see sometimes the maindiv content is truncated.
            >
            > All Ajax calls are made using the function CaricaPagina(div, url) in
            > js/rudy_test.js
            >
            > the function to resize the layout (adatta();) is inside the homepage, and it
            > is call at the end of success handler of CaricaPagina.
            >
            > I tried to call layout.resize() as you suggeted instead of adatta(), but the
            > resize is not done.
            >
            > Thankyou
            > Rudy
            >
            > --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
            >>
            >> 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
            >> >
            >> >
            >>
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.