javascript - Ask a question about dribbble website

WBOY
Release: 2016-10-11 14:23:36
Original
1126 people have browsed it

When I click to view the work page, the URL in the browser changes. The page does not jump, but the work details page pops up, and the work can be switched left and right. How can this effect be achieved?

javascript - Ask a question about dribbble website

javascript - Ask a question about dribbble website

Reply content:

When I click to view the work page, the URL in the browser changes. The page does not jump, but the work details page pops up, and the work can be switched left and right. How can this effect be achieved?

javascript - Ask a question about dribbble website

javascript - Ask a question about dribbble website

---Update---

After checking, changing the url is implemented through the Js method window.history.pushState(). For the API, please refer to the link description. For example, enter in the current window console:

<code>window.history.pushState('q1000', 'Title', '/q/1000');</code>
Copy after login
You can change the current url without reloading the page.
Changing the title is easy, just document.title='question100'
This kind of user interaction is worth learning from.

Look at the network request to see how it is implemented. I guess it's asynchronous loading? Or HTTP 2?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template