Is there some obvious way, maybe some feature of the plugin, to go to top of a div on which I have jquery-endless-scroll applied.
Currently, I was trying something like:-
function backToTop() {
alert("I am here.");
var deviceList = $("#list");
var scrollPosition = deviceList.scrollTop();
alert("scrollPosition:- "+scrollPosition);
deviceList.scrollTop = 0;
}
And, I have used this plugin successfully on #list. But, the above code which is mapped to a button’s onClick() gives me the scroll scrollPosition value in the alert but the “deviceList.scrollTop = 0;” line doesn’t seem to have any effect.
Hi,
Is there some obvious way, maybe some feature of the plugin, to go to top of a div on which I have jquery-endless-scroll applied.
Currently, I was trying something like:-
function backToTop() { alert("I am here."); var deviceList = $("#list"); var scrollPosition = deviceList.scrollTop(); alert("scrollPosition:- "+scrollPosition); deviceList.scrollTop = 0;
And, I have used this plugin successfully on #list. But, the above code which is mapped to a button’s onClick() gives me the scroll scrollPosition value in the alert but the “deviceList.scrollTop = 0;” line doesn’t seem to have any effect.
Any ideas?