metafizzy / flickity-hash

Select Flickity slides with links
11 stars 10 forks source link

Using flickity hash in website with subfolders. #6

Open jorisvanhouts opened 5 years ago

jorisvanhouts commented 5 years ago

Hi,

Thanks for creating and sharing flickity hash.

I noticed when using flickity in a website with subfolders (e.g. https://www.site.com/subfolder/). The browser address is replaced with only the domain and the hash (https://www.site.com/#slide-1). If a user manually refreshes the pages after this change. the browser redirects back to root, which is our case is not desirable.

I changed the onChangeHash function to bypass this issue: var url = window.location.pathname + '#' + id;

Maybe this could be a nice addition to your library?

jdaehne commented 4 years ago

+1 This would be a great fix.

desandro commented 2 years ago

Thanks for reporting this issue. What browsers are you seeing this behavior in?