1

I have a single page website. When I visit the domain of the site, it starts me off half way down the page. I'm not sure what's causing this. Has anyone experienced this before? I can provide the link to the site if necessary.

My index.php page....

<?php
    require "requires/top.php";
    require "requires/nav.php";
    require "main/landed.php";
    require "main/about.php";
    require "main/galleries.php";
    require "main/contact.php";
    require "requires/footer.php";
?>


<script type="text/javascript" src="js/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/wow.min.js"></script>
<script type="text/javascript"> new WOW().init(); </script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/instafeed.min.js"></script>
<script type="text/javascript" src="js/magic.js"></script>
<script type="text/javascript" src="js/contest.js"></script>
<script type="text/javascript" src="js/feed.js"></script>
<script type="text/javascript" src="js/feed2.js"></script>
<script type="text/javascript" src="js/gal-switch.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.1/jquery.form.js"></script>
3
  • Yes, please post the link.
    – Phix
    Commented Oct 6, 2017 at 0:28
  • jackloudphoto.com Commented Oct 6, 2017 at 0:32
  • Your page is loading perfectly fine. The problem is that it's automaticly scrolling down underneath your image slider. It's most likely caused by a setting or somewhere in the JS file related to it.
    – icecub
    Commented Oct 6, 2017 at 0:35

2 Answers 2

4

Your page scrolls down because it centers the "First Name" input in the contact section because it has the autofocus attribute.

<div id="first-name-group" class="form-group">
    <input type="text" name="txtFirstName" class="form-control" placeholder="First Name" id="firstName" autofocus>
</div>

Just remove the autofocus attribute.

If you want to learn more I recommend to read the MDN Web Documentation.

0
1

When someone visits your website, the menu at the top has Photography selected by default, which has the anchor tag's href set to #gallery (line 24 in source code). The page loads to the div element that has the exact id attribute (line 110 in source code) of gallery.

There is code that is executing an animation based on which menu tag is set as the default by whatever CMS you are using. I would change the default page to be set to Home, which would then ensure that the homepage always loads at the top.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.