javascript restore style
<p>I want to see a specific div on full-screen and change style and for this, I used this function: </p>

<pre><code>$(function () {
  $('#trigger').click(function () {
      var screenres = screen.width + 'x' + screen.height;
      document.getElementById("map").style.backgroundColor = "white";
      if (screenres == "1920x1080") {
          document.getElementById("map_canvas").style.height = "1000px";
      }
      if (screenres == "1366x768") {
          document.getElementById("map_canvas").style.height = "600px";
      }     
  });
}
</code></pre>

<p>The style is changed but it doesn't return to its former state. For example before full-screen;  the map div's height:300px  after the full-screen its value 1000px.</p>

<p>How can I return first value?</p>
