Working with single page websites and maintaining state using a URL hash and jQuery

后端 未结 4 1951
孤独总比滥情好
孤独总比滥情好 2020-12-01 06:08

I\'m working on my portfolio, making it entirely jQuery based. So my problem is when you go to a page, then refresh then it will take you to the home page again. So I have t

4条回答
  •  攒了一身酷
    2020-12-01 06:44

    This is not the way web sites are usually built, so in a sense you are swimming upstream. It may have seemed the shorter path when you began, but you will probably find that you must do a lot more work as a result of your initial decision.

    That said, be sure to start with all the divs hidden and then display the selected one.

    I also recommend Cowboy's BBQ plugin which will help you deal with back button as well as reload: http://benalman.com/projects/jquery-bbq-plugin/

提交回复
热议问题