jQuery unbind behaviour after function runs
<p>I have a toolbar that manipulates a Google map. Some of the functions affect markers placed on the map. I have a reset button that clears the changes and returns the map to the original state.</p>

<p>I need to "disable" the reset button until the map is changed. So...</p>

<ol>
<li>When an action is completed that manipulates the map, I bind the ResetMap() function to the reset button. </li>
<li>Reset button is clicked and returns the map to original state.</li>
<li>Reset button action is unbound again.</li>
</ol>

<p>However, I can't get step 3 to work. I tried to unbind the event at the end of the ResetMap() function like so:</p>

<pre><code>function ResetMap(){
 var Wrapper = $("#page_layout").find("#InlineToolbarMessages");
 if(Wrapper.hasClass('isExpanded')){
  Wrapper.removeClass('isExpanded');
  Wrapper.addClass('isCollapsed');
 }
 $("#page_layout").find('#NumSelectedNumber').html("0");
 $("#page_layout").find('div#SelectedVoters').html("");
 clearMarkers();
 $('#page_layout').find('#reset_button').unbind('click', function(){
  ResetMap();
 });
}
</code></pre>

<p>I also tried a more global:</p>

<pre><code>$('#page_layout').find('#reset_button').unbind();
</code></pre>

<p>without success. What am I doing wrong?</p>
