Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one way scrolling 1

Status
Not open for further replies.

lumy

Programmer
Jul 25, 2001
3
CA
I have a page with a header image that is 1275 pixels long to accommodate for all screen resolutions. However on smaller screens I need to stop the browser from scrolling horizontally due to the picture. I need a script that will allow the page to scroll vertically but get rid of the horizontal scroll bar.

Any help would be appreciated
lumy
 
Hi lumy,

There isn't a way to do that with script (since that's a function of the browser, not the page being displayed), you can, however, create a table that is 1275 px wide and set it as its background image. That should do it.

-Scott
 
No no, not quite! [COLOR=003366]scotth4v[/color] was close, but you'll still have the same problem if you make a table that's 1275px wide. Make the table whatever width you want the page layout to be (if it's a "flexible" layout, then make it whatever percentage), ignoring the image issue for the moment. Then insert your 1275px-wide image as a background image in the table cell.

[COLOR=003366]lumy[/color], putting a background image in a table cell is kind of like, um, holding up a huge painting behind a window. Not in the window, but behind it. If the window is smaller than the painting, you'll only see the part of the painting that fits in the window. The rest of it will be hidden. Since it's behind our hypothetical window (background image), not in it (image), it doesn't stretch out the window. When someone comes along with a saw and makes the window bigger, they'll be able to see more of the painting. (Thus, err on the side of a little excess length.)

It's great to see you're taking varying resolution into account.
But please, stay away from trying all those silly JavaScript solutions to what is really a simple issue. And allow me to voice a vehement protest against using JavaScript to resize an image! Always always always insert images at actual size, and don't use the browser to specify a different size. Image quality, especially with .gif images, instantly goes down the hole (completely transparent spacer .gif's are one of the only exceptions) when you resize in the browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top