In a contact page there is in order: a banner, map and form.
How can I make the page automatically scroll down by letting the page start automatically from the map?
In a contact page there is in order: a banner, map and form.
How can I make the page automatically scroll down by letting the page start automatically from the map?
In the header, <head></head>
, add the following code between the <script></script>
tag:
$(document).ready(function() {
window.location.href='#foo';
});
The ready()
method indicates that the script within the function will run only when the page is ready with all elements loaded.
This way, you do not need to put the script at the bottom of the page, as well as being more secure.
Where you want the page to stop scrolling, place:
<a href="#" id="foo"></a>
An example would be window.scrollTo(0, 10);
as I do not know anything about your source code, what gives p / answer would be that.
You can use the page ID itself as a reference to use as anchor Example: But # is needed in javaScript window.location.href = '#DataPage';
You can use an anchor:
place this code at the end of your page
<script>
window.location.href='#ancora';
</script>
and now put a <a href="#" id="ancora">
field below the div or html element.