Trouble passing 'this' to correct variable

Trouble passing 'this' to correct variable

  1. <script>

  2.             $( ".info_button" ).on( "click", function() {

  3.                 var position = $( ".result_content" ).css( "margin-top" );

  4.                 if ( position == "-170px" ) {

  5.                     $( ".result_content" ).animate({

  6.                         marginTop: "0",

  7.                     }, 500 );

  8.                 } else {

  9.                     $ ( ".result_content" ).animate({

  10.                         marginTop: "-170px",

  11.                     }, 500 );

  12.                 }

  13.             });

  14. </script>
See the above code that I will be referencing throughout my question.

This bit of code essentially detects the location of a <div>, and then responds accordingly by either sliding it upwards, or sliding it back downwards into its original position.

My problem is that I have multiple of the .result_content <div>, and when I click the .info_button, it displaces every .result_content <div>, rather than just the one that the button is on. I once tried replacing .result_content with 'this', but it then shifted the .info_button <div> upwards rather than the .result_content <div>.

For your convenience, I have provided a selection of the html below:

  1. <div class="result_content">
  2.                 
  3.                     <p class="title">Title</p>
  4.                 
  5.                     <p class="description">Description</p>
  6.                 
  7.                     <p class="visit_site">Visit Site</p>

  8.                     <p class="info_button">More<p>

  9. </div>