Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How jump inside page?

Reply
Thread Tools

How jump inside page?

 
 
robertbaer@teranews.com
Guest
Posts: n/a
 
      09-07-2012
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>
 
Reply With Quote
 
 
 
 
Ed Black
Guest
Posts: n/a
 
      09-07-2012
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;}

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-07-2012
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
 
Reply With Quote
 
robertbaer@teranews.com
Guest
Posts: n/a
 
      09-09-2012
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..

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-09-2012
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
 
Reply With Quote
 
robertbaer@teranews.com
Guest
Posts: n/a
 
      09-11-2012
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.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-11-2012
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
 
Reply With Quote
 
patriic48@gmail.com patriic48@gmail.com is offline
Junior Member
Join Date: Oct 2012
Location: Middle Sweden
Posts: 15
 
      10-16-2012
<a href="#City">

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

<a name="City">

Regards - patriic48
 

Last edited by patriic48@gmail.com; 10-18-2012 at 10:56 AM.. Reason: Correction
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Double left click jump to top, same with ctrl or shift to jump to bottom? Eadwine Rose Javascript 2 10-15-2006 08:38 PM
Running Firefox from a Jump Drive ?? Perk Firefox 3 02-08-2006 07:58 PM
Weird Problem: Auto-Jump page doesn't show up in "BACK" history VB Programmer ASP .Net 2 10-23-2003 04:53 PM
Preventing jump to top of screen during postback Guenther Liebowitz ASP .Net 2 08-14-2003 04:58 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