SlideBar

K

Kevin Spencer

Hi Mike,

You might be able to find one ready-made on the Internet. You could write
your own as well. It would have to be done using JavaScript and HTML. My
guess would be that it would use Divs for the most part. The scroll "groove"
would be an image. The slider would be a div that has event handlers for
onmousedown, onmousemove, and onmouseup. It would use CSS styles and
JasvaScript to move the slider.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
M

Mike

Thanks Kevin.
I already did that, but i don't know how to limit the slider to the table
limits without use absolute-position.
Can u help me?
This's the HTML:

<script language="javascript">

var Dragging = false;
var CurrentControl,CurrentControlY, CurrentControlYTemp;

function OnMove()
{
if (event.button == 1 && Dragging)
{
CurrentControl.style.pixelTop = CurrentControlYTemp + event.clientY -
CurrentControlY;
return false;
}
}

function OnDrag()
{
if (!document.all)
return;
if (event.srcElement.className=="drag")
{
Dragging = true;
CurrentControl = event.srcElement;
var o = document.all.tblLalala;
CurrentControlYTemp = CurrentControl.style.pixelTop;
CurrentControlY = event.clientY;
document.onmousemove = OnMove;
}
}
</script>
.....
<body>
<table height="100%" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="right">
<table id="tblLalala" height="100%" width="15" cellpadding="0"
cellspacing="0" style="BORDER-RIGHT: 2px inset; BORDER-TOP: 2px inset;
BORDER-LEFT: 2px inset; MARGIN-RIGHT: 10px; BORDER-BOTTOM: 2px inset">
<tr height="50%">
<td bgcolor="#ffffff" align="right">
<IMG class="drag" src="images/pointer.bmp">
</td>
</tr>
<tr height="50%">
<td bgcolor="#ff0000"></td>
</tr>
</table>
</td>
</tr>
</table>

<script language="javascript">
document.onmousedown = OnDrag;
document.onmouseup = new Function("Dragging = false");
</script>

</body>
.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top