📜 ⬆️ ⬇️

One-page site

I’m redoing my little website’s friend now, and decided to make it on one page, but at the same time that it was with full navigation, page navigation, so that history worked, and you could copy and open the link of any page. As a bonus, the pages are opened with an animated effect.

Here is the simplest example of a one-page site , all the code (almost *) inside this page.

* For history to work in IE, you need a hidden frame, where the hist.html file serving navigation in this browser will be loaded. The truth works in IE pretty bad compared to other browsers.

If you wish, you can load pages with Ajax, and make a website that works without scripts as usual, and with the included scripts without overloading the main page and only loading the necessary data, you can use any animation effects. But that's another topic.
')
Of course there are also disadvantages in this approach, search engines will find only one page, and will link to it. In my implementation, jQuery is used (I need it for other things on the site being developed), but it can be done without this js framework.

Source: https://habr.com/ru/post/62938/


All Articles