x,y of page and not browser window needed

Discussion in 'Javascript' started by Larz, May 22, 2009.

  1. Larz

    Larz Guest

    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>
    Larz, May 22, 2009
    #1
    1. Advertising

  2. Larz

    David Mark Guest

    On May 22, 4:19 pm, Larz <> 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]
    David Mark, May 22, 2009
    #2
    1. Advertising

  3. Larz

    Larz Guest

    On May 22, 5:10 pm, David Mark <> wrote:
    > On May 22, 4:19 pm, Larz <> 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 ?
    Larz, May 26, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Tm92aWNl?=
    Replies:
    2
    Views:
    6,613
    Alan Ferrandiz Langley
    Jun 9, 2004
  2. UJ
    Replies:
    2
    Views:
    7,478
    John Timney \(ASP.NET MVP\)
    Jun 27, 2005
  3. Gordon
    Replies:
    3
    Views:
    280
    Steven Burn
    Apr 16, 2004
  4. msa
    Replies:
    19
    Views:
    288
    Brian Genisio
    Apr 30, 2004
  5. Mortisus
    Replies:
    2
    Views:
    202
    Mortisus
    Mar 29, 2005
Loading...

Share This Page