0

After the ajax success i want to scroll down the page to certain position .

Unfortunately its not working .

Here is the code :

jQuery('#post').submit(function(e){

    var name    = jQuery("#bs_floor_listing").val();
    var post_ID = jQuery("#bs_project_post_id").val();
    var data    = {
                    'action': 'bs_floorlisting_result',
                    'name': name,
                    'post': post_ID
                  };

    jQuery.post(ajaxurl, data, function(response) {
     jQuery('html, body').animate({
                                scrollTop: jQuery("#tabbed").offset().top
                                }, 2000);
    });

});
Chinou
  • 461
  • 1
  • 5
  • 23

1 Answers1

0

Its working now !

Now after ajax response its coming to the same position where the form was submitted.

Instead of this code

jQuery('html, body').animate({
     scrollTop: jQuery("#tabbed").offset().top                               
}, 2000);

I replaced to

location.reload();
Chinou
  • 461
  • 1
  • 5
  • 23