Javascript Help !!!!!
Javascript Help !!!!!
- Started
- Last post
- 4 Responses
- dbloc
Ok I have an image that is
width: 1500px
height: 610px;the image it contained in a div
I want this image to be 100% the height of the window.
If the full width of the image is showing, just center the image left to right.
If the window is smaller than the width of the image, I want it to center in the div.
I know this can be done by adjusting the margin-left on window resize. I just can't figure out the correct math.
Thanks for any help!!!!
- BabySnakes0
onResize{
margin-left = (windowWidth - imageWidth/2)
}I would need to see more but sound like it would be simple enough?
- hereswhatidid0
Can you change it to be a background image and then use one of these techniques?
- ideaist0
Use Background Stretcher: