title: Why fancybox doesn't bind at the first time on this code?
body: <p>I have an input element and a link next to it. User enters some text in input and click link to do a query to find something related to what he enters. The result should be shown using fancybox. Here is my js code:</p>
  
  <pre><code>$(".srcaut").click(function() { 
          if($(this).prev("input").val() == '') {
              alert('Empty field');
              return false;
          }
  
          srch = $(this).attr("id").replace("srch-",'');
  
          $(this).attr('href',Url+'/'+srch+'/'+$(this).prev("input").val());
          $(this).fancybox();
  
      }).prev("input").keypress(function(even) {
           if(even.keyCode == 13) {
              $(this).next('.srcaut').click();
              return false;
          }
  
  }); 
  </code></pre>
  
  <p>But fancybox isn't shown the first time user enter some text and click on link or hit the 'Enter' key after the page loaded. but after that is works. </p>
  
  <p>What is the problem. Is seems fancybox doesn't bind to link at the first time, but why ?</p>