Scroll to the top of the page during get quote
Fourth most popular feature request http://support.admnetwork.com/entries/20511662-clicking-on-next-during-get-a-quote-should-go-to-the-top-of-the-next-page could be implemented by adding code below
The script is also interesting due to the fact that it shows a way to override a function and subsequently call original code + do something else.
var selectNextPage = (function() {
var original = selectNextPage;
return function() {
original();
scroll(0, 0);
if (console) console.log('next');
}
})();
var selectPreviousPage= (
function() {
var original = selectPreviousPage;
return function() {
original();
scroll(0, 0);
if (console) console.log('prev');
}
})();
-
I've created a separate entry for this here so developers will hopefully notice your override code: http://support.admnetwork.com/entries/21254106-how-to-override-system-javascript-function-and-still-call-original
Please sign in to leave a comment.
Comments
2 comments