Trigger hype functions with Hashtags

Continuing the discussion from Browsers Back Button:

The idea is to add to the URL a custom #hashtag each time you trigger each symbol.

This are the ingredients.

1
window.location.hash
It allows you to modify the URL so you can input a hashtag location.

2
if (window.location.href.indexOf("lobby") > -1) { // your code here }
This allows to launch any function you want depending on what the #hashtag in the URL is.

3
$(window).bind("hashchange", function() { // more codes });
This is the only jquery code needed, it allows to launch a function if the URL is modified, which is going to happen when you switch from symbol to symbol.

In my file you are going to find that I am using hype API to launch a group of “IF” that will trigger a different even for each # in the URL.

hashtag_back.zip (103.5 KB)

2 Likes

Nice technique!