views:

76

answers:

3
+1  Q: 

Javascript Resize

Hi,

I have very little javascript knowledge, so it seems a very basic question, but could not find a way to do that.

I have a 1024*768 fixed area like this:

alt text

There will be a javascript button on the right side of the "Section A". When I click that button, Section A will be automatically resized and it will be something like this:

alt text

So, Section A will overlap with Section B, and it will be same size with Section C (And i know the size of Section C). How can I automatically resize that area with overlap function? I am looking a plugin for Jquery, but could not find that. There is a resizable function in Jquery, but it does not help me. Could you help me out? (If you just give me a link that is related with this feature, that would be enough too)

edit: For extra note, Section A is a flash object, so it will enlarge and overlap with Section B when I click to that button.

Thanks,

A: 

The jQuery hide() effect would be useful here. If both Section A & Section B have a float: left Section A should expand to fill the area when Section B is hidden.

http://docs.jquery.com/Effects/hide

pygorex1
Thanks for the answer, yes it is possible with this, however I do not want to hide the Section B.It is very hard for me to explain in English, but I would like to give this example:If you look at here: http://www.scribd.com/doc/23640532/Elisa-Hanukkah-Cards You can resize the flash object (right bottom), so it overlaps with the content. So, I will have the same function as well, also there will be a button that resize the object automatically with a fixed size. I just need a button that automatically resize it. Thanks again
murat
For what I've understood, you want to make section A resize over section B, like layers, right? If so, leave a comment that I'll give you a light.
yoda
yes exactly right..
murat
A: 

Have you tried the animate function? http://docs.jquery.com/Effects/animate

Could have Section B hide with a slide or have Section A overlap it like you mentioned just need to set the positioning, z-index, etc. properly.

mbrevoort
hmm thanks a lot for this, I will try it.
murat
you'll need a bit more than that.
yoda
A: 

something like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Terminal</title>
  <script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
  <script type="text/javascript">
   $(function () {
    $('#but').click(function (e) {
     $('#a').removeClass('big').addClass('normal');
     $('#b').hide();
     e.preventDefault();
    });
   });
  </script>
  <style type="text/css">
   .height {
    height: 100px;
    border: 1px solid black;
   }

   .big {
    width: 198px;
    float: left;
   }

   .small {
    width: 100px;
    float: left;
   }

   .normal {
    width: 300px;
    clear: both;
   }
  </style>
 </head>
 <body>
  <div><a href="#" id="but">button</a></div>
  <div id="a" class="height big">a</div>
  <div id="b" class="height small">b</div>
  <div class="height normal">c</div>
 </body>
</html>
Robert Cabri