2016-10-29 18:32
浏览 58


I don't know how to explain my question in the title... :D I made a photo gallery and want to make the images, info, etc to be shown in an overlay. Everything works nice, but I would like the URL to be changed to the image page URL. As example I could name the galleries of Pinterest. Thx for your help or any ideas how I could go on searching!

图片转代码服务由CSDN问答提供 功能建议

我不知道如何在标题中解释我的问题......:D 我做了一个照片库 并希望使图像,信息等以叠加方式显示。 一切都很好,但我希望将URL更改为图像页面URL。 例如,我可以为Pinterest的画廊命名。 请求您的帮助,或者我可以继续搜索的任何想法!

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongyang2229 2016-10-29 18:39

    I'd suggest looking into the HTML5 History API and pushState() more specifically. I can't write an implementation here, but that's the basic answer to your question – the History API will let you change the URL without reloading the page. The real challenge you'll run into is how to handle history navigation from there (using JS to attach a listener for navigation) and to receive a URL for the gallery as generated by JS and show the right image within it.

    解决 无用
    打赏 举报

相关推荐 更多相似问题