开发者

Jquery Treeview Plugin Location persistance

开发者 https://www.devze.com 2023-03-26 05:25 出处:网络
Love the JQuery Treewiev plugin http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ , but I have one problem with it.

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

精彩评论

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