x,y of page and not browser window needed

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>
 
D

David Mark

 I am using this javascript library fromhttp://www.cylo.co.uk/ResizableTables.html

Stop.

isIE:function ()
{
var browserName=navigator.appName;
if(browserName.toUpperCase().indexOf("MICROSOFT")>-1)
{
return true;
}else{
return false;
}
},

As with jQuery 1.2x as well as virtually every library released since
2000, this script is now completely unusable. The inferences made
from the results of this bizarre function are invalid in IE8 (in its
default configuration anyway.) In the greater sense, they weren't
valid to begin with and breaking documents in IE8 is the inevitable
result (see jQuery, Prototype, Mootools, etc.)

Throw it away. For those with jQuery 1.2x, the advice is the same.
Perfect time to jump off the bandwagon as 1.3x is an unmitigated
disaster (and largely incompatible with the old versions.)

[snip]
 
L

Larz

 I am using this javascript library fromhttp://www.cylo.co.uk/ResizableTables.html

Stop.

isIE:function ()
        {
                var browserName=navigator.appName;
                if(browserName.toUpperCase().indexOf("MICROSOFT")>-1)
                {
                        return true;
                }else{
                        return false;
                }
        },

As with jQuery 1.2x as well as virtually every library released since
2000, this script is now completely unusable.  The inferences made
from the results of this bizarre function are invalid in IE8 (in its
default configuration anyway.)  In the greater sense, they weren't
valid to begin with and breaking documents in IE8 is the inevitable
result (see jQuery, Prototype, Mootools, etc.)

Throw it away.  For those with jQuery 1.2x, the advice is the same.
Perfect time to jump off the bandwagon as 1.3x is an unmitigated
disaster (and largely incompatible with the old versions.)

[snip]


I don't quite follow what you are saying and what that isIE function
is about ?
I found that I could fix the problem I had in firefox by using pageX
instead of clientX, but I do see there may be an IE issue and pageX
might not be available in IE.
I had a requirement for resizable table cells via drag and drop and
this had been working for me except in the case mentioned and it seems
ok in firefox. How else could I resize tables ?
 

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,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top