Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page Layout and implementation

I have a single-page layout that uses # in a fixed navigation to move up and down the page. When the page loads I want the viewport to display the second section not the top section.

Do I have to use something like an "onload" go to #first when the page is loaded in the browser?

Here is a website that accomplishes what I am trying to do: http://volll.com/#section_main

<nav>
  <ul>
    <li><a href="#top">Top</a></li>
    <li><a href="#first">First</a></li>
    <li><a href="#second">Second</a></li>
 </ul>
</nav>


<section id="top">
  <h2>Top</h2>
  <p> blah </p>
</section>

<section id="first">
  <h1>First</h1>
  <p>You see this first</p>
</section>

<section id="second">
   <h2>Two</h2>
   <p>blah</p>
</section>
like image 572
jonky Avatar asked Jul 05 '26 12:07

jonky


1 Answers

<body onload="window.location='#second'">
like image 116
Chris Matthews Avatar answered Jul 07 '26 00:07

Chris Matthews



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!