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

Re: [JavaScript] Help with this resize script

Expand Messages
  • Jonas Raoni
    ... Mine one is much smaller and work with if I remember: :) Anyway, I think you should forward your question
    Message 1 of 6 , Aug 8, 2007
    • 0 Attachment
      On 8/7/07, Mike Jablonski <lehula@...> wrote:
      > I found this light re-sizing script.
      > http://www.twinhelix.com/javascript/dragresize/demo/
      > The only problem is, that it only works with divs, as far as I can
      > tell. I really need it to work with images. I tried substituting the
      > divs with an img like this

      Mine one is much smaller and work with <img> if I remember:
      <URL:http://jsfromhell.com/dhtml/resizer> :)

      Anyway, I think you should forward your question directly to the code
      author instead of this list.


      --
      Jonas Raoni Soares Silva
      http://www.jsfromhell.com
    • Mike Jablonski
      ahhhh, you area an angel. This will just as well. I searched all over for resize scripts that were light yet effective. never came across yours. thanks.
      Message 2 of 6 , Aug 8, 2007
      • 0 Attachment
        ahhhh, you area an angel. This will just as well. I searched all
        over for resize scripts that were light yet effective. never came
        across yours. thanks.
      • Mike Jablonski
        ... I noticed your shift resize doesn t work to maintain aspect ratio on box2. It triples in size, then maintains that ratio. Anychance you could fix this.
        Message 3 of 6 , Aug 8, 2007
        • 0 Attachment
          --- In JavaScript_Official@yahoogroups.com, "Jonas Raoni"
          <jonasraoni@...> wrote:
          >
          > On 8/7/07, Mike Jablonski <lehula@...> wrote:
          > > I found this light re-sizing script.
          > > http://www.twinhelix.com/javascript/dragresize/demo/
          > > The only problem is, that it only works with divs, as far as I can
          > > tell. I really need it to work with images. I tried substituting the
          > > divs with an img like this
          >
          > Mine one is much smaller and work with <img> if I remember:
          > <URL:http://jsfromhell.com/dhtml/resizer> :)
          >
          > Anyway, I think you should forward your question directly to the code
          > author instead of this list.
          >
          >
          > --
          > Jonas Raoni Soares Silva
          > http://www.jsfromhell.com
          >

          I noticed your shift resize doesn't work to maintain aspect ratio on
          box2. It triples in size, then maintains that ratio. Anychance you
          could fix this. Or make it so that if one of the corner boxes was
          used to resize, it would maintain aspect ratio. Thanks for the script
          though. I am learning a lot from it.
        • Mike Jablonski
          How would I use this if I wanted multiple ids to use the same characteristic as say, box2? Is there some way to make a list of the id s I want resizable?
          Message 4 of 6 , Aug 9, 2007
          • 0 Attachment
            How would I use this if I wanted multiple ids to use the same
            characteristic as say, box2? Is there some way to make a list of the
            id's I want resizable?
          • Jonas Raoni
            ... This shift resize is just an example of filter (my code doesn t include any default filter), it keeps a 1:1 ratio, not the original ratio, so the height
            Message 5 of 6 , Aug 10, 2007
            • 0 Attachment
              On 8/9/07, Mike Jablonski <lehula@...> wrote:
              > I noticed your shift resize doesn't work to maintain aspect ratio on
              > box2. It triples in size, then maintains that ratio. Anychance you
              > could fix this.

              This shift resize is just an example of filter (my code doesn't
              include any default filter), it keeps a 1:1 ratio, not the original
              ratio, so the height will have the same value as the width, it's the
              why it as you said "triples in size".

              > Or make it so that if one of the corner boxes was used to resize,
              > it would maintain aspect ratio.

              You need to add another filter =b

              > Thanks for the script though. I am learning a lot from it.

              Ok :)

              > ahhhh, you area an angel.

              I wouldn't bet my coins on it xD

              > This will just as well. I searched all
              > over for resize scripts that were light yet effective. never came
              > across yours. thanks.

              It's strange, but simple, the only thing it has more is the filter, I
              made these codes when I was unemployed, now I dont have time to
              update/send new, so if you find a bug dont expect me to fix too xD

              > How would I use this if I wanted multiple ids to use the same
              > characteristic as say, box2? Is there some way to make a list of the
              > id's I want resizable?

              Look at the example snippet and you'll see:

              shiftResize = function(e, o){
              var c = this, d = c.w - c.h;
              e.shiftKey && o.h != 1 && o.v != 1 &&
              (d > 0 ? c.h = c.w : c.w = c.h,
              !o.v ? d > 0 ? c.y -= d : !o.h && (c.x += d)
              : !o.h && d < 0 && (c.x += d));
              }
              resizer.addFilter(shiftResize);

              Where "e" is the mousemove event, "o" the resizer instance itself (the
              description of the resizer properties you can see on the site) and the
              "this" will be a object like this {x:0, y:0, w:0, h:0}, by changing
              one of the properties, you change the position or size of the resizer.


              --
              Jonas Raoni Soares Silva
              http://www.jsfromhell.com
            Your message has been successfully submitted and would be delivered to recipients shortly.