-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page link #28
Comments
I have the same issue, I need to have the pages reachable by a URL, beacause I have anchors for every item, and they are reachable only for the first page. How can I achieve this? |
Any help? |
For the anchors I resolved by disabling jPages if there is an anchor in the URL, but I know it's not the answer for your question. |
I needed to do something similar to this, and came up with the following setup: /** turn the query string into a javascript object */
function getQueryParams() {
var queryString = location.search.substr(1).split('&');
var params = {};
queryString.forEach(function(param) {
var p = param.split('=');
params[p[0]] = p[1];
});
return params;
}
/** updates the location bar with the current page */
function updatePageParam(pageNum) {
var baseUrl = location.pathname.replace(/\/$/, '');
baseUrl += pageNum > 1 ? '/?page=' + pageNum : '';
history.replaceState(null, null, baseUrl);
}
/** Paginates the list of categories using jPages plugin */
function paginate() {
var params = getQueryParams();
$('.pagination').jPages({
containerID: 'pages',
startPage: params.page,
callback: function(pages) {
updatePageParam(pages.current);
}
});
} Hope this helps, even though it's quite a few months after you asked the question! |
How can I make as an exemplary'm second page and the addres link in url to be (example) www.site.com/scrollbrowse.html?page=2.
Thanks
The text was updated successfully, but these errors were encountered: