Here is the existing script that I am using to filter some product details in my page. Currently, on filtering it loads a "loading" GIF animation. Instead of that I want it to scroll to the top using simple div id function. consider the page URL is http://websitename.com/folder/index.php, I am able to scroll to the top using
<a href="#top" class="nav-link">Go to top</a>
How can I automatically scroll to the top by changing this JQuery script ?
I want to use this function instead of <div id="loading" style="" ></div>
, how can I do that ?
<script>
$(document).ready(function(){
filter_data();
function filter_data()
{
$('.filter_data').html('<div id="loading" style="" ></div>');
var action = 'fetch_data';
var minimum_price = $('#hidden_minimum_price').val();
var maximum_price = $('#hidden_maximum_price').val();
var brand = get_filter('brand');
var ram = get_filter('ram');
var storage = get_filter('storage');
.....