theniteowl
Programmer
Hi Everyone,
I need to float a small image over top of the up and down arrows of the scrollbar in a div.
I am using the overflow property in the div to give it the scrollbar but I want the arrows to be covered by another image.
I need to do this because it is impossible to capture the click of the arrows and I need to do this. The onscroll event has proved inadequate for what I need to do.
Can I use relative positioning to put the two graphics into their proper places or do I need to use absolute positioning to do it?
I am not experienced doing this and my attempts so far always end up with the relatively positioned item just to the left of the scrollbar so I think perhaps the scrollbar itself it not considered part of the block? Any way to address the scrollbar to do it or do I have to resort to absolute positioning?
Here is a simple script to show the box with scrollbar, if anyone can show me what to add to do the positioning I would be enormously grateful.
<html>
<head>
<style type="text/css">
<!--
div.scroll {
height: 200px;
width: 300px;
overflow: auto;
border: 1px solid #666;
background-color: #ccc;
padding: 8px;}
-->
</style>
</head>
<body>
<table width="300" border="1" bgcolor="lightgrey">
<tr>
<td>
<div class="scroll" id="scrolldiv">
<p>Scrolling text box.</p>
<p><span style="color: red;">This is red color</span>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>This is a normal paragraph.
<span style="font-weight: bold; font-size: 22px;">This is big bold text</span>
</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
</div>
</td>
</tr>
</table>
</body>
</html>
TIA.
Nite
I need to float a small image over top of the up and down arrows of the scrollbar in a div.
I am using the overflow property in the div to give it the scrollbar but I want the arrows to be covered by another image.
I need to do this because it is impossible to capture the click of the arrows and I need to do this. The onscroll event has proved inadequate for what I need to do.
Can I use relative positioning to put the two graphics into their proper places or do I need to use absolute positioning to do it?
I am not experienced doing this and my attempts so far always end up with the relatively positioned item just to the left of the scrollbar so I think perhaps the scrollbar itself it not considered part of the block? Any way to address the scrollbar to do it or do I have to resort to absolute positioning?
Here is a simple script to show the box with scrollbar, if anyone can show me what to add to do the positioning I would be enormously grateful.
<html>
<head>
<style type="text/css">
<!--
div.scroll {
height: 200px;
width: 300px;
overflow: auto;
border: 1px solid #666;
background-color: #ccc;
padding: 8px;}
-->
</style>
</head>
<body>
<table width="300" border="1" bgcolor="lightgrey">
<tr>
<td>
<div class="scroll" id="scrolldiv">
<p>Scrolling text box.</p>
<p><span style="color: red;">This is red color</span>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>This is a normal paragraph.
<span style="font-weight: bold; font-size: 22px;">This is big bold text</span>
</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.</p>
</div>
</td>
</tr>
</table>
</body>
</html>
TIA.
Nite