Frage

I am using Tocify to make a TOC for some content on my site. Let's say my site is called www.example.com and I click an element in my TOC. The default option for Tocify is to change my url to www.example.com?elementclicked

But my site is www.mysite.com/index.php?page=folder/test/ShowSite&tabid=1&site_id=87. If I click an element, it changes the url to www.mysite.com?elementClicked. How can I make it change the link to www.mysite.com/index.php?page=folder/test/ShowSite&tabid=1&site_id=87?elementClicked?

War es hilfreich?

Lösung

I wrote Tocify and just updated Tocify to v1.1.0, which no longer uses History.js or the HTML5 push state API for history management. Instead, a hash is used (which should fix your issue). Please grab the latest Tocify code and let me know if you have any other issues. Thanks!

Andere Tipps

Appending current URL will automatically lead to page reloading. That can probably be tweaked by preventing page to auto-load but instead of adding ?elementClicked you could add #elementClicked ...

window.location.hash = 'elementClicked';
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top