[Resolved] When filtering a view, jump to view location on page
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here is that the user has a filter on their page that refreshes the page to load the results but the user wanted to jump to the view after the page reloads.
It doesn't seem to be working for me but I think it is for a different type of view. I just have a simple view that I need the page to jump down to.
This is the js that I added to my views JS Editor:
the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}();
if(QueryString.wpv_view_count && QueryString.wpv_view_count == "596-TCPID97") {
location.hash = "#licensed-coach-view";
}