tags:

views:

44

answers:

3

Hey all,

I'm trying to build a blog. I would like to create a design that essentially slides out more of the picture when you drag the browser handle to the right, and slides in to a certain point when you drag the browser handle to the left. How do you do this in css??

EDIT: I'm thinking you could use a float:right, width:100%, overflow:hidden, combination or something..

Thanks! Matt Mueller

A: 

You will need to use JavaScript. Do you mean the browser handle as in the scrollbar?

This might also be a bad idea considering how much of the net is accessed today on handheld systems. Also, performance may suffer if a large image is being moved around per resizing.

alex
I mean just resizing the browser window when I say dragging the handles.
Matt
If you use a background, you can set its position. When you resize the browser it will appear to slide with the movement (for example by positioning your browser center or right).
Sohnee
A: 

You have to wire an onresize event for the window object using javascript.

window.onresize

An event handler for the resize event on the window.

rahul
+1  A: 

Okay. I knew I was missing something. Maybe I just wasn't explaining the question well enough.. either way.. This is what I did.

#header {
background('header.png') top right repeat-x
width: 100%;
}

Now as long as I make sure the background is repeatable, I'll be in good shape.

Matt