为什么要加这段代码?
$('.captcha').blur(function(){
 $('.yzm-box').hide();
 });

解决方案 »

  1.   

    点击刷新的时候加个 $('.yzm-box').show(); 勉强能用用
      

  2.   

    不加这个它离开input框不会隐藏啊。
      

  3.   

    方法中
    function getcode(URL){
    var  di=$('.yzm-box');
    di.empty();
    ("<img id=\"imgverify\" src=\"“+URL+”\" width=\"60\" height=\"20\" onclick=\"getcode()\" />")
    }
      

  4.   

    ("<img id=\"imgverify\" src=\"“+URL+”\" width=\"60\" height=\"20\" onclick=\"getcode()\" />").appent(di);
      

  5.   

    var handler = null;function clearh(){
          if(handler){
              clearTimeout(handler);
              handler = null;
          }
    }$(function(){
    $('.captcha').focus(function(){
            clearh();
            $('.yzm-box').show();
    });$('.captcha').blur(function(){
         clearh();
         handler = setTimeout(function(){$('.yzm-box').hide();},12);  
    });
    })刷新验证码:
    function getcode(){
             var img = $("#imgverify");    
      img.src = "../index/code.html";
            $('.captcha').focus();
        }