Web Setup
- I have
tab-pane
that are active. - Elements that bounce to other elements and trigger other
tabs
. - Using Bootstrap and jquery.
GOALS
- When user clicks a navigation link I store the elements
ID
and the activePANE
into the URL as a hash.http://www.mywebsite.com/#pane#id
- I'd like to store this into the browser history so when the user presses the
BACK
orFORWARD
button I can pull down thatBACK
url parse out the location activate thePANE
andscrollTop
to the element `ID'. - Obviously when the
BACK
orFORWARD
button leaves our domain I'd like to warn the user before leaving the page. - I would like this to work on browsers
IE8
and forward. CurrentFireFox
,CHROME
andOPERA
. - BONUS if this would work in Mobile Webviews.
Research
- I found the links and projects below but I'm not sure if these are the most current or best solutions to my problem.
https://github.com/blixt/js-hash
Keeping history of hash/anchor changes in JavaScript
How to get the anchor from the URL using jQuery?
Questions
- Is this even possible as I read that you can't change the
BROWSER HISTORY
-- which makes sense. - Are the above projects a good fit or is there a better solution that can meet my wish list?
- Is it possible to create a global jquery click listener that runs before any of my other listeners that simply gets the element
ID
and activePANE
then stores them into anArray
. I would simply intercept the back/forward button events grab that Array object and set the DOM from it.
Thanks for your help!