开发者

JS tabbed navigation - how keep url's working

I've built a basic tabbed interface using jQ开发者_如何学Pythonuery using this technique. I want to be able to link to the page with different tabs open.

At the moment the index page loads and holds the content for all the pages in hidden divs and displays each with an animation when the tab is selected. I want to keep this functionality, but also allow direct links (domain.com/section_title) to work. Right now jQuery is adding the functionality to links using href elements set to element ids (href="#section").

Thanks for any help!


The best strategy here is to link directly to domain.com/Index.html#section and set up the jquery to load the "section" tab as pre-opened on the page.

It's not trivial to set up domain.com/index/section syntax for this functionality, because the server will look for a "section" page and not load your tabbed "index" page by default. However, there are ways to do it, such as via ASP.NET Routing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜