Hey, small issue. I’m using jQuery to show and hide divs to simulate page changes via regular nav links. Each page has a table of image links.
Lets say I’m on the main page and click page 1 (fade in, cooool), page 2 (fade in, cooool). Click link to new page. When I click back, I want to return to “page two”. Is there a simple (or not) way to acheive this?
I assume the lack of replies here is a lack of knowledge/possibility and not a lack of understanding? I wish this was possible.
- United States
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Referred between 100 and 199 users
- Bought between 100 and 499 items
- Author was Featured
- Microlancer Beta Tester
- Exclusive Author
I’m no programmer at all but from what I know you would have to set a cookie for the last tab open and then call that cookie for reference when that page is next displayed.
Sorry I can’t help much more…
- Envato Staff
- Has been a member for 4-5 years
- Attended a Community Meetup
- Australia
- Beta Tester
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
You mean something like this? http://www.mikage.to/jquery/jquery_history.html
^ Almost. I mean, yes, but it doesn’t seem to work with what I’m doing. The jQuery I’m using are not legitimate ajax calls, just showing and hiding divs already on the page.
It appends the hash and number, but when I click back it just removes the hash, doesn’t go back to the previously shown div.
You can try window.onbeforeunload.
Let me get this straight- you’re not actually navigating to a different page when the back button is clicked- you just want to show a different div?
This is the biggest problem with tabs. Even theme forest can’t manage to solve it (the tabs on the front page)
Bummer. I guess I’ll have to live without it.
- Envato Staff
- Has been a member for 4-5 years
- Attended a Community Meetup
- Australia
- Beta Tester
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
This is the biggest problem with tabs. Even theme forest can’t manage to solve it (the tabs on the front page)
I don’t think it’s something most people want tied to tabs. The back button on your browser is meant for navigating pages, not page elements like tabs. Personally, if I was browsing through a site and tried to use the back button but it navigated back through tabs first I’d be a little annoyed. Why not just put back/forward navigation buttons somewhere near the tabbed content?
