How jump inside page?

Discussion in 'HTML' started by robertbaer@teranews.com, Sep 7, 2012.

  1. Guest

    I have tried many variations of this and all are nogo (no jump).
    It would seem that (somehow) i need to force the browser to
    scan/pre-scan the full markup before execution.

    ** sample: how can i make it work?

    <!DOCTYPE html>
    <html lang="en">
    <head>
    </head>
    <body>
    <!-- sample Does NOT go to "skipp" -->
    <div class="grid_13 padtop">
    <h3>"Get in Touch"..</h3>

    <script>
    window.location.replace('s.html#skipp');
    </script>

    <form id="contact-form">
    <div class="success"> Contact form submitted!<br> <strong>We will
    be in touch soon.</strong></div>
    <fieldset>
    <label class="name">
    <input type="text" value="Name:">
    <span class="error">*This is not a valid name.</span>
    <span class="empty">*This field is required.</span>
    <span class="clear"></span>
    </label>
    <label class="email">
    <input type="text" value="E-mail:">
    <span class="error">*This is not a valid email address.</span>
    <span class="empty">*This field is required.</span>
    <span class="clear"></span>
    </label>
    <label class="phone">
    <input type="text" value="Phone:">
    <span class="error">*This is not a valid phone number.</span>
    <span class="empty">*This field is required.</span>
    <span class="clear"></span>
    </label>
    <label class="message">
    <textarea>Message:</textarea>
    <span class="error">*The message is too short.</span>
    <span class="empty">*This field is required.</span>
    <span class="clear"></span>
    </label>
    <div class="buttons"><span><a class="button"
    data-type="reset">Clear</a></span>
    <span><a class="button"
    data-type="submit">Submit</a></span></div>
    </fieldset>
    </form>
    <br>
    <a name="skipp">This is after form.<br> </a>
    </div>
    </body>
    </html>
    , Sep 7, 2012
    #1
    1. Advertising

  2. Ed Black Guest

    On 2012-09-07 07:08:36 +0100, said:

    > I have tried many variations of this and all are nogo (no jump).
    > It would seem that (somehow) i need to force the browser to
    > scan/pre-scan the full markup before execution.


    It works, but will not be apparent with the code you provided because
    insufficient space is provided below the targeted anchor for the
    browser to show it at the top of the viewport.

    To demonstrate this, add the following CSS to pad out the body at the bottom.

    body {padding-bottom:1000px;}
    Ed Black, Sep 7, 2012
    #2
    1. Advertising

  3. wrote:
    > I have tried many variations of this and all are nogo (no jump).
    > It would seem that (somehow) i need to force the browser to
    > scan/pre-scan the full markup before execution.
    >
    > ** sample: how can i make it work?
    >
    > <!DOCTYPE html>
    > <html lang="en">
    > <head>
    > </head>
    > <body>
    > <!-- sample Does NOT go to "skipp" -->
    > <div class="grid_13 padtop">
    > <h3>"Get in Touch"..</h3>
    >
    > <script>
    > window.location.replace('s.html#skipp');
    > </script>


    In addition yo what Ed wrote, your inline script is ABOVE your anchor,
    so it will fail because the anchor "skipp" does not exist in the DOM yet
    when it fires. You have two options. Either attache the function to the
    windows's onload event guaranteeing which fires after the whole page is
    loaded insuring "skipp" exists. Or place the inline script in the
    document AFTER the anchor markup.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Sep 7, 2012
    #3
  4. Guest

    Jonathan N. Little wrote:
    > wrote:
    >> I have tried many variations of this and all are nogo (no jump).
    >> It would seem that (somehow) i need to force the browser to
    >> scan/pre-scan the full markup before execution.
    >>
    >> ** sample: how can i make it work?
    >>
    >> <!DOCTYPE html>
    >> <html lang="en">
    >> <head>
    >> </head>
    >> <body>
    >> <!-- sample Does NOT go to "skipp" -->
    >> <div class="grid_13 padtop">
    >> <h3>"Get in Touch"..</h3>
    >>
    >> <script>
    >> window.location.replace('s.html#skipp');
    >> </script>

    >
    > In addition yo what Ed wrote, your inline script is ABOVE your anchor,
    > so it will fail because the anchor "skipp" does not exist in the DOM yet
    > when it fires. You have two options. Either attache the function to the
    > windows's onload event guaranteeing which fires after the whole page is
    > loaded insuring "skipp" exists. Or place the inline script in the
    > document AFTER the anchor markup.
    >

    Well,fussing with the onload made no difference, and it seems to make
    no sense to have the browser scan and render all the way down to the
    "jump" script to make it go back up and thus endlessly repeat.
    Will have to think of another way to get this cat out of its skin..
    , Sep 9, 2012
    #4
  5. wrote:

    > Well,fussing with the onload made no difference, and it seems to make
    > no sense to have the browser scan and render all the way down to the
    > "jump" script to make it go back up and thus endlessly repeat.
    > Will have to think of another way to get this cat out of its skin..
    >


    Well maybe if you supplied a URL to the page, we might be able to spot
    was your are doing wrong.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Sep 9, 2012
    #5
  6. Guest

    Jonathan N. Little wrote:
    > wrote:
    >
    >> Well,fussing with the onload made no difference, and it seems to make
    >> no sense to have the browser scan and render all the way down to the
    >> "jump" script to make it go back up and thus endlessly repeat.
    >> Will have to think of another way to get this cat out of its skin..
    >>

    >
    > Well maybe if you supplied a URL to the page, we might be able to spot
    > was your are doing wrong.
    >

    Thanks for the offer..in effect i have a new cat, complete with skin
    and fur.
    , Sep 11, 2012
    #6
  7. wrote:
    > Jonathan N. Little wrote:
    >> wrote:
    >>
    >>> Well,fussing with the onload made no difference, and it seems to make
    >>> no sense to have the browser scan and render all the way down to the
    >>> "jump" script to make it go back up and thus endlessly repeat.
    >>> Will have to think of another way to get this cat out of its skin..
    >>>

    >>
    >> Well maybe if you supplied a URL to the page, we might be able to spot
    >> was your are doing wrong.
    >>

    > Thanks for the offer..in effect i have a new cat, complete with skin
    > and fur.
    >


    Are you sure it not another turkey?

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Sep 11, 2012
    #7
  8. Joined:
    Oct 13, 2012
    Messages:
    6
    Location:
    Middle Sweden
    HTML Jump

    <a href="#City">

    and then the target in the code where the jump target is:

    <a name="City">

    Regards - patriic48
    Last edited: Oct 18, 2012
    , Oct 16, 2012
    #8
    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. VB Programmer
    Replies:
    2
    Views:
    466
    VB Programmer
    Oct 23, 2003
  2. =?Utf-8?B?TWVyZGFhZA==?=

    Edit on Datagrid causes the page to jump on the screen

    =?Utf-8?B?TWVyZGFhZA==?=, Aug 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    374
    Teemu Keiski
    Aug 16, 2005
  3. VanguardLH
    Replies:
    13
    Views:
    1,163
    dorayme
    Mar 2, 2011
  4. Eadwine Rose
    Replies:
    2
    Views:
    190
    Eadwine Rose
    Oct 15, 2006
  5. Replies:
    31
    Views:
    169
    Tim Rentsch
    Apr 15, 2014
Loading...

Share This Page