Double left click jump to top, same with ctrl or shift to jump to bottom?

Discussion in 'Javascript' started by Eadwine Rose, Oct 14, 2006.

  1. Eadwine Rose

    Eadwine Rose Guest

    I have this little bitty script on my site that makes a jump to the top
    of the screen when one double left clicks anywhere in the page.

    I was wondering if it could be altered so the double left click stays
    present as it is, and when a key is pressed alongside it, say.. shift,
    ctrl, alt.. , it will jump to the bottom instead of the top.

    Here is the code as it is now:


    <script type="text/javascript">
    function dblclick() {
    window.scrollTo(0,0);
    }
    if (document.layers) {
    document.captureEvents(Event.ONDBLCLICK);
    }
    document.ondblclick=dblclick;
    </script>


    Is this possible at all?
    Thanks!
    Eadwine Rose
    Eadwine Rose, Oct 14, 2006
    #1
    1. Advertising

  2. Eadwine Rose

    Bosconian Guest

    "Eadwine Rose" <> wrote in message
    news:...
    >I have this little bitty script on my site that makes a jump to the top
    > of the screen when one double left clicks anywhere in the page.
    >
    > I was wondering if it could be altered so the double left click stays
    > present as it is, and when a key is pressed alongside it, say.. shift,
    > ctrl, alt.. , it will jump to the bottom instead of the top.
    >
    > Here is the code as it is now:
    >
    >
    > <script type="text/javascript">
    > function dblclick() {
    > window.scrollTo(0,0);
    > }
    > if (document.layers) {
    > document.captureEvents(Event.ONDBLCLICK);
    > }
    > document.ondblclick=dblclick;
    > </script>
    >
    >
    > Is this possible at all?
    > Thanks!
    > Eadwine Rose
    >


    You might try placing an anchor at the bottom of the page.
    Bosconian, Oct 14, 2006
    #2
    1. Advertising

  3. Eadwine Rose

    Eadwine Rose Guest

    > You might try placing an anchor at the bottom of the page.

    Thing is I know virtually NOTHING of javascript, so I have no idea on
    how to even begin with this. Yes I could do it through HTML, easily,
    but I want it to be sort of a mouse gesture rather than a link that has
    to be clicked.
    Eadwine Rose, Oct 15, 2006
    #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. Wenjie
    Replies:
    3
    Views:
    1,019
    Ron Samuel Klatchko
    Jul 11, 2003
  2. Cuthbert
    Replies:
    8
    Views:
    421
    Ancient_Hacker
    Sep 13, 2006
  3. Santosh Nayak

    Left Shift / Right Shift Operators

    Santosh Nayak, Nov 30, 2006, in forum: C Programming
    Replies:
    16
    Views:
    1,433
    CBFalconer
    Nov 30, 2006
  4. Sanny
    Replies:
    38
    Views:
    3,348
    Thomas Richter
    Apr 29, 2011
  5. pc
    Replies:
    2
    Views:
    1,293
    crisgoogle
    Jun 8, 2011
Loading...

Share This Page