Click to See Complete Forum and Search --> : Make scrollable image


aescott
04-07-2008, 06:17 AM
Hi

I've developed a small website using a mixture of HTML, PHP and JavaScript. The site queries a database and draws a temperature graph with the data collected.

The problem I have is that the graph is far too large to fit into the browser window, often extending to 20,000+ pixels on the horizontal axis.

Is there a way in which I can have a fixed window for the graph with its own scrollbars, in addition to those provided by the browser?

Thanks

coothead
04-07-2008, 06:42 AM
Hi there aescott,

have a look at this example, you should be able to adapt it to your requirements...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<base href="http://mysite.orange.co.uk/azygous/images/">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
#container {
width:200px;
height:616px; /* img height plus 16px for horizontal scrollbar*/
border:1px solid #000;
margin:auto;
overflow:auto;
}
#container img {
width:800px;
height:600px;
display:block;
}
</style>

</head>
<body>

<div id="container">
<img src="autumn.jpg" alt="">
</div>

</body>
</html>

coothead