使用jQuery cookie记住菜单位置 [英] Use jQuery cookie to remember menu position

查看:87
本文介绍了使用jQuery cookie记住菜单位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要对一个长菜单进行分页—一次5个左右的菜单项.

I'm paginating a long menu — 5 or so items at a time.

http://jb.waterstreetgm.org/projects/fixed-height/

(此处为侧边栏菜单)

问题在于,当我单击上一步"/更多",然后单击新的5列表中的链接时,它会忘记我所在的5列表.

The problem is that when I click Back / More and then click a link in the new list of 5, it forgets which list of 5 I was on.

我想我需要以某种方式使用cookie来记住我在哪里,但是我什至不知道从哪里开始.如果有人可以给我关于如何开始对该菜单进行cookie化的基本概念,我将不胜感激.

I guess I need to use cookies somehow to remember where I was, but I don't even know where to get started. If someone could give me the basic idea of how I get started cookie-ifying this menu, I'd greatly appreciate it.

我正在使用的代码示例在这里: http://jsfiddle.net/saltcod/bXKsZ/1/

The code example I'm working from is here: http://jsfiddle.net/saltcod/bXKsZ/1/

感谢您的帮助

特里

推荐答案

我认为这是使用基于哈希的历史记录/导航的机会.检查一下:

I would see this as an opportunity to use hash based history/navigation. Check this out:

https://github.com/cowboy/jquery-hashchange

那应该让您入门.

这篇关于使用jQuery cookie记住菜单位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆