Move Image or Div Up As Window Resizes?

Posted by Wade D Ouellet on Stack Overflow See other posts from Stack Overflow or by Wade D Ouellet
Published on 2010-05-23T01:28:14Z Indexed on 2010/05/23 1:30 UTC
Read the original article Hit count: 435

Filed under:
|
|
|
|

Hi,

I have an image in my html with a class of "stretch".

Currently, with css, this image re-sizes as the window re-sizes to be 100% of the screen width. I would also like it to move upwards as the window is being re-sized.

I'm assuming this can be done with jQuery but I am not quite sure. Basically the "top" css value just needs to change as the screen width does.

Here is the css that is currently re-sizing it:

.stretch {
width: 100%;
height: auto;
min-height: 420px;
position: absolute;
top: -200px;
}

Thanks,

Wade

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about css