L
Larz
I am using this javascript library from http://www.cylo.co.uk/ResizableTables.html
that enables resizing of a table via drag and drop. A problem I am
having is when the table is really large and it goes off the browser
window such that the browser gives you a slider at the bottom.
In order to simulate a simple test so I can work out a possible fix,
I have some code at the bottom which seems to give me a possible way
to try to work this out as to what I could do. I have an event handler
on mousedown that gives me x,y of the mouse. I generate a dummy table
row that will cause a scroll bar area to the right. When I go all the
way to the right, the cooridnate will be the same whether or not the
slider has moved. When the slider is moved to the right, I want to get
the actual x that I am looking for I believe or something similar,
basically how can I tell how far the horizontal slider bar has moved
or where I am relative to the html and not the browser window ?
============================
<html>
<head>
<script type="text/javascript">
function show_coords(event)
{
x=event.clientX;
y=event.clientY;
alert("X coords: " + x + ", Y coords: " + y);
}
</script>
</head>
<body>
<div onmousedown="show_coords(event)">
<p>Click in the document. An alert box will alert the x and y
coordinates of the mouse pointer.</p>
<table>
<tr>
<td>frog</td>
<td>frog</td>
<td>frog</td>
<td>frog</td>
.... many more etc
</tr>
</table>
</div>
</body>
</html>
that enables resizing of a table via drag and drop. A problem I am
having is when the table is really large and it goes off the browser
window such that the browser gives you a slider at the bottom.
In order to simulate a simple test so I can work out a possible fix,
I have some code at the bottom which seems to give me a possible way
to try to work this out as to what I could do. I have an event handler
on mousedown that gives me x,y of the mouse. I generate a dummy table
row that will cause a scroll bar area to the right. When I go all the
way to the right, the cooridnate will be the same whether or not the
slider has moved. When the slider is moved to the right, I want to get
the actual x that I am looking for I believe or something similar,
basically how can I tell how far the horizontal slider bar has moved
or where I am relative to the html and not the browser window ?
============================
<html>
<head>
<script type="text/javascript">
function show_coords(event)
{
x=event.clientX;
y=event.clientY;
alert("X coords: " + x + ", Y coords: " + y);
}
</script>
</head>
<body>
<div onmousedown="show_coords(event)">
<p>Click in the document. An alert box will alert the x and y
coordinates of the mouse pointer.</p>
<table>
<tr>
<td>frog</td>
<td>frog</td>
<td>frog</td>
<td>frog</td>
.... many more etc
</tr>
</table>
</div>
</body>
</html>