Need help adding scrollTo to bottom pagination
Need help adding scrollTo to bottom pagination
brianfidler
Posts: 21Questions: 1Answers: 0
on this page: http://waldronsfarm.com/index.php/products/
I have added a function to scroll to the top of the page when First, Last, Previous, and Next are clicked. For some reason I can't seem to add the function to the numeric pagers though. Is it because they are dynamically generated?
Here is the jquery function that works on First, Last, Previous, and Next. I've tried a number of different iterations, even hacking the core datatables code to add a class="paginate_button_container" to the span that wraps around the number buttons, but nothing seems work in making them activate the scrollTo function.
[code]
jQuery(".paging_full_numbers").click(function(){
//$.scrollTo scrolls the whole screen
//alert(".paginate_button was just clicked");
jQuery.scrollTo( 0, 400);
return false;
});
[/code]
Please let me know what I need to do to get this functionality to work on the numbers.
thanks.
I have added a function to scroll to the top of the page when First, Last, Previous, and Next are clicked. For some reason I can't seem to add the function to the numeric pagers though. Is it because they are dynamically generated?
Here is the jquery function that works on First, Last, Previous, and Next. I've tried a number of different iterations, even hacking the core datatables code to add a class="paginate_button_container" to the span that wraps around the number buttons, but nothing seems work in making them activate the scrollTo function.
[code]
jQuery(".paging_full_numbers").click(function(){
//$.scrollTo scrolls the whole screen
//alert(".paginate_button was just clicked");
jQuery.scrollTo( 0, 400);
return false;
});
[/code]
Please let me know what I need to do to get this functionality to work on the numbers.
thanks.
This discussion has been closed.
Replies
Allan
Can you help me out with the syntax, I changed my code to the following, but it still only works on the four non-dynamic elements, First, Last, Previous and Next.
[code]
jQuery(".paging_full_numbers span.paginate_button").live({
click: function() {
jQuery.scrollTo( 0, 400);
}
});
[/code]
thanks,
brian
Allan
brian
Allan
thanks Allan!