Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > x,y of page and not browser window needed

Reply
Thread Tools

x,y of page and not browser window needed

 
 
Larz
Guest
Posts: n/a
 
      05-22-2009
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>
 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      05-22-2009
On May 22, 4:19*pm, Larz <wbsurf...@gmail.com> wrote:
> *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]
 
Reply With Quote
 
 
 
 
Larz
Guest
Posts: n/a
 
      05-26-2009
On May 22, 5:10*pm, David Mark <dmark.cins...@gmail.com> wrote:
> On May 22, 4:19*pm, Larz <wbsurf...@gmail.com> wrote:
>
> > *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 ?




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a new browser window to a specific size without the menu bar and address window. UJ ASP .Net 2 06-27-2005 08:21 PM
Detecting when my browser opens a new browser window Mortisus Javascript 2 03-29-2005 02:24 PM
How to use an asp:button to create a new browser window and output contents to new window =?Utf-8?B?Tm92aWNl?= ASP .Net 2 06-09-2004 10:54 PM
Browser to fullscreen - solution needed for many browser/platform combinations msa Javascript 19 04-30-2004 04:04 PM
Need to open a new browser window, not a new window Gordon ASP General 3 04-16-2004 10:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57