Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    23
    Member #
    18106
    is there a way to have the browser back button work when I am using the navigation to hide and show divs rather than loading a new html page?

    here's the site

    CSS file

    thanks for any help...

  2.  

  3. #2
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    Your websites extremely confusing, probably since your navigation is white. Anyways, as its a work in progress...looks pretty good i like the design. really elegant and clean.

    im not sure i understand your question, however im assuming your using javascript to hide / show divs? I know jquery offhand, my pure javascript isnt too great. but why not just have

    var lastDiv="lastdivname";

    and make your own back button. then code some javascript to show the lastDiv. What you're trying to do isnt possible (at least as far as i know).

    Why are you hiding/displaying divs? You have very small html files with very small graphics and very little content a 0.1 second page reload is not going to really affect you. If the usability is that much of a concern, just make seperate pages. Sure, you need a page reload when you change pages, but people are used to that. If they hit BACK and they go to google.com where they came from, they may get pissed (i would).

    Anyways, I really think you should just settle on page reloads. But chances are you wont be able to override the back buttons...i mean, if you could do that all my websites would override the back button so that the person stays on my website.

  4. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    23
    Member #
    18106
    Your websites extremely confusing, probably since your navigation is white.
    Thanks for the reply. I haven't tested the site in all browsers yet, just safari and firefox so thats probably why the navigation isn't showing up for you.

    im assuming your using javascript to hide / show divs?
    Yes I'm using javascript to hide and show the layers.

    Why are you hiding/displaying divs?
    I absolutely love how clean the site feels when you don't see the whole page reload when navigating between sections. I think it adds a minor but nice touch to the site I'd like to keep in tact.

    Sure, you need a page reload when you change pages, but people are used to that.
    I don't want to settle because people are used to page reloads. It actually will give me a slight upper hand in that sense if they don't see that .1 second reload that they might see on other sites. The average user won't know why but things will seem easier and a lot cleaner to them.

    why not just have

    var lastDiv="lastdivname";

    and make your own back button.
    Making my own back button would defeat the purpose of what I'm trying to do because I want to make things as simple as possible and I agree that I'd be pissed as well if I hit the browser back button and went to google.com.

    What you're trying to do isnt possible (at least as far as i know).
    Here's and example of what I'm talking about and why I think it's possible: http://brewerymusic.com

    I know it's a flash site but the concept remains the same: The back button goes to the previous section of the site without reloading the whole page.

  5. #4
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    thats definitely an interesting technique.
    i've never seen it before

    Heres from his source:
    <scripttype="text/javascript" src="js/swfaddress.js"></script>


    Hes using this component to rewrite his urls.
    http://www.asual.com/swfaddress/docs/en/
    Basically, it looks like the component creates history entries. And if I remember correctly, the browser back button does a history.go(-1); or something like that (at least thats how you emulate a back button in javascript)

    "Occasionally, it is necessary to change the page address using a script. The typical way to do this is by assigning a new address to location.href. This adds a history entry, and loads a new page, in the same way as activating a normal link." - http://dev.opera.com/articles/view/e...script/?page=4
    So when you change your tab, maybe you can change the location.href (i dont believe this causes a page reload, if it does you may be able to add return false; to stop the behavior). This would create history entries for you and you could use the browsers back button. You'd also have to handle the page load to set the current tab based on the url.
    http://forums.devarticles.com/javasc...ge-103475.html
    Maybe parent.location.hash is more appropriate, it seems location.href will always reload the page.
    Anyways, I think ive given you enough to get you started.
    Good luck with your implementation

  6. #5
    Banned
    Join Date
    Apr 2010
    Posts
    1
    Member #
    21782
    I have visited many places across the Internet and after searching, talking particularly with each <ERROR. SPAM REMOVED. ERROR BEEEEPPPP> I found a site that told me the ideal way of what I needed on a website, I showed that web design in a virtual store is very important, after some long talks acknowledges that the site is very good and after 3 months of continuous use, it is becoming very well.;-)

  7. #6
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    WOW! REALLY COREY? THAT'S INCREDIBLE! HOLY COW! THANK YOU, THAT'S JUST WHAT I'VE BEEN LOOKING FOR!

    sorry for yelling

  8. #7
    Junior Member
    Join Date
    Jan 2009
    Posts
    23
    Member #
    18106
    thanks aburningflame I'm going to start messing with that. I don't know a whole lot about JavaScript to be honest. It's all kind of trial and error for me and good detective work. This time you did the detective work for me! We'll see how this goes.

    Corey you're a lifesaver. I can't wait to take my site from "very good" to "very well"!

  9. #8
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    YES! VIRTUAL STORES!! Thanks corey.

    gluck real deal

  10. #9
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    Hey Real Deal, you might like this:

    4. APIs


    HTML 5 introduces a number of APIs that help in creating Web applications. These can be used together with the new elements introduced for applications:
    • 2D drawing API which can be used with the new canvas element.
    • API for playing of video and audio which can be used with the new video and audio elements.
    • Persistent storage. Both key / value and a SQL database are supported.
    • An API that enables offline Web applications.
    • An API that allows a Web application to register itself for certain protocols or MIME types.
    • Editing API in combination with a new global contenteditable attribute.
    • Drag & drop API in combination with a draggable attribute.
    • Network API.
    • API that exposes the history and allows pages to add to it to prevent breaking the back button. (This API has the necessary security restrictions in place.)
    http://www.w3.org/TR/2008/WD-html5-d...80122/#doctype

    ENJOY!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

back button js show hide

,
hide div on back button
,
html hidden div back button
Click on a term to search for related topics.
All times are GMT -6. The time now is 07:55 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com