title: JavaScript is there a way to stop href="#" to refresh a page ? nyroModal
body: <p>Is there some script that can stop <code>&lt;herf=&quot;#&quot;&gt;</code> from refreshing a page?</p>
  <p>You might ask why I would do that? Well I am enhancing an old .net web project,
  it uses nyroModal jQuery to open up a lightbox with, but when I try to close up the lightbox, nyroModal applies a hash (i.e. <code>#</code>) at the end of the URL and cause the page to refresh, which causes the screen to flip (bad user experience)</p>
  <h3>Javascript code:</h3>
  <pre><code>$(function () {
      //set up light box
      var width = 766;
      var height = 591;
      $('.nyroModal').nyroModal({
          sizes: {
              initW: width, initH: height,
              minW: width, minH: height,
              w: width, h: height
          },
          callbacks: {
              beforeShowCont: function () {
                 =$('html').css('overflow', 'hidden');
                 =//width = $('.nyroModalCont').width();
                 =//height = $('.nyroModalCont').height();
                 =$('.nyroModalCont').css('width', width);
                 =$('.nyroModalCont').css('height', height);
                 =$('.nyroModalCont iframe').css('width', width);
                 =$('.nyroModalCont iframe').css('height', height);
              =},
              =afterResize: function () {
                 $('html').css('overflow', 'hidden');
              },
              afterShowCont: function () {
                 $('html').css('overflow', 'hidden');
              },
              afterClose: function () {
                 $('html').css('overflow', 'auto');
                 //resizeBackground();
              }
           }
       });
   });
  </code></pre>
  <p>It would be great if anyone can show me how to solve this refreshing problem with a hash at the end of the URL. Or after refresh, my screen position stay the same. Not going up or down many thanks</p>