john_yourspace
asked on
Infinite Scroll Back Button
Hi guys,
I am using infinite scroll like this
Which works perfectly except for the back button, any suggestions this is a wordpress site
thanks,
J
I am using infinite scroll like this
$('#primaryArticleWrapper').infinitescroll({
loading: {
finished: undefined,
finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
img: "",
msg: null,
msgText: "<em>Loading.</em>",
selector: null,
speed: 'fast',
start: undefined
},
navSelector : "#nav-below",
// selector for the paged navigation (it will be hidden)
nextSelector : "div .nav-previous a:first",
// selector for the NEXT link (to page 2)
itemSelector : ".article"
// selector for all items you'll retrieve
});
// unbind normal behavior. needs to occur after normal infinite scroll setup.
$(window).unbind('.infscr');
$('#nav-below').hide();
$("a.articleLoadMore").click(function(){
$('#primaryArticleWrapper').infinitescroll('retrieve');
return false;
});
Which works perfectly except for the back button, any suggestions this is a wordpress site
thanks,
J
ASKER
Hi Eemit,
I am not sure how this will work,
The problem is the user scrolls through a number of pages using infinite scroll
so for example he scrolls to page 10 and clicks through to a post , when the back button is used the user is back on page one
I am not sure how this will work,
The problem is the user scrolls through a number of pages using infinite scroll
so for example he scrolls to page 10 and clicks through to a post , when the back button is used the user is back on page one
Put that in jQuery(document).ready function e.g.:
jQuery(document).ready(function($){
// put the code I posted in here.
});
ASKER
but i dont want to scroll to the top?
Oh sorry! my bad!
ASKER
no problem
Did you saw how Facebook and Google+ handled this issue ?
ASKER
is it hash bang or?
Are you using the Infinite Scroll plug-in, or something hand-rolled?
http://www.infinite-scroll.com/
What version of WordPress are you using?
http://www.infinite-scroll.com/
What version of WordPress are you using?
ASKER
using the js from infinite-scroll.com
3.9.1
3.9.1
I wonder if that problem is related to this post:
Screw Hashbangs: Building the Ultimate Infinite Scroll
http://tumbledry.org/2011/05/12/screw_hashbangs_building
Screw Hashbangs: Building the Ultimate Infinite Scroll
http://tumbledry.org/2011/05/12/screw_hashbangs_building
ASKER
Thanks Bob I seen that, found it tough to understand, we didnt bother implementing it in the end
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Assumes you have this in your template:
Open in new window