Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

How to animate to the selected record #121

Open
arie051267 opened this issue Dec 17, 2020 · 0 comments
Open

How to animate to the selected record #121

arie051267 opened this issue Dec 17, 2020 · 0 comments

Comments

@arie051267
Copy link

arie051267 commented Dec 17, 2020

Hello,

Is it possible to achieve the following?

I use the tool in a search field of a table (filled from a mysql db) with usernames and the points they have gained. When they click on the user they want to see on which place he has ended, the template.php file wil do the same query and show the results.

But I want to autoscroll to the desired row in this table.

I try this one:

` success: function(data){
// If the success function is execute, then the Ajax request was successful.
// Add the data we received in our Ajax request to the "content" div.
$('.table_with_results').html(data);

            $('#tableID').animate({
              scrollTop: $("#userID").offset().top
            }, 1000);            
        
      },`

But the scroll doesn't work.

Any idea how to achieve this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant