The Tree Slider
Those of you running recent versions of Safari, Chrome, or Firefox 4 may have noticed some changes to tree browsing on GitHub. The new HTML5 History API (which really has…
Those of you running recent versions of Safari, Chrome, or Firefox 4 may have noticed some changes to tree browsing on GitHub.
The new HTML5 History API (which really has nothing to do with HTML — it’s a JavaScript API) allows us to manage the URL changes while CSS3 transitions handle the sliding. Permalinks are always maintained, your back button works as expected, and it’s much faster than waiting for a full page load.
Basically we intercept your click, call pushState()
to change the browser’s URL, load in data with Ajax, then slide over to it.
When you hit the back button, an onpopstate
handler is fired after the URL changes, making it easy to send you “back”.
Want more? Check out the HTML History API Demo and MDC’s Manipulating the browser history documentation. Facebook has blogged about their use of this stuff, and Flickr has been doing it for months on their lightbox view.
There’s also some hot replaceState()
action over on our new Features page and the Pull Requests dashboard.
We’re still getting all the kinks out of the Tree Slider, but we hope you like it!
Written by
Related posts
![](https://github.blog/wp-content/uploads/2025/01/innovation_graph_1.png?resize=400%2C212)
That’s a wrap: GitHub Innovation Graph in 2024
Discover the latest trends and insights on public software development activity on GitHub with the release of Q2 & Q3 2024 data for the Innovation Graph.
![](https://github.blog/wp-content/uploads/2024/07/Screenshot-2024-07-23-at-8.46.23 AM.png?resize=400%2C212)
Seven years of open source: A more secure and diverse ecosystem
Explore insights into open source community growth, innovation, and inclusivity with an updated survey dataset.
![](https://github.blog/wp-content/uploads/2023/09/1200x630-Enterprise-Unfurl-DARK-Inverto.png?resize=400%2C212)
GitHub Availability Report: December 2024
In December, we experienced two incidents that resulted in degraded performance across GitHub services.