开发者

Jquery Treeview Plugin Location persistance

Love the JQuery Treewiev plugin http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ , but I have one problem with it.

I am using location based persistence, but if there is a get variable in the u开发者_开发知识库rl it doesn't persist correctly.

For example: htp://yourwebpage.com/group

is recognized differently than htp://yourwebpage.com/group?group_id=555

I understand why there might be cases that they shouldn't match, but is there a way to get treeView to match these two states. So how can I fixed this problem?


you can change the way of accessing location in the jquery.treeview.js

var current = this.find("a").filter(function() {
  return this.href.toLowerCase() == location.href.toLowerCase();
});

to

var current = this.find("a").filter(function() {
  return this.href.toLowerCase() == location.href.toLowerCase().split("?")[0];
});

or use cookie persistence and set the cookie value to location.href.toLowerCase().split("?")[0]

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜