Div弹出层-当鼠标移上去出现一个层,鼠标移开这个层消失的特效,大家可以直接拿去用

 

/*弹出div显示客户信息 Create CopyRight:jinpeilong 2012*/  
  function createXhR()
   {
    var xhr;   
   
    try
    {
     xhr = new ActiveXObject("Msxml2.XMLhTTP");
    }
    catch(e)
    {
     try
     {
      xhr = new ActiveXObject("Microsoft.XMLhTTP");
     }
     catch(e)
     {
      xhr = false;
     }
    }   
    if(!xhr && typeof XMLhttpRequest != 'undefined') xhr = new XMLhttpRequest();
   
    return xhr;
   }
  
  function divyy(fw, name)
  {
  
    if(document.getElementById('div3')!=null)
         {
          var div21="div3";
          RemoveDiv(div21);
          }
         var div2= document.createElement("div");
         div2.id="div3";
         var clientxs=event.clientX;
         var clienty=event.clientY-100;

         var srtr="";


var srtr="";
 var xhr;
    xhr = createXhR();
    var url="../Photo.aspx?cid="+fw+"";
    xhr.open("post", url,false);
 
    xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
      srtr = xhr.responseText;
    }   
    xhr.send(null);
 
 
    var sr=srtr.split("|");
             var str="

";
  str +="
  str +="style='cursor:move;width:97%;height:25px;background-color:#ebf1ff; font-size:14px;padding-left:10px;padding-top:10px;font-size:14px;text-align:left' >"+ name+"-联系信息
";
  str +="
";
  str +="
职位:
"+sr[0]+"
";
  str +="联系电话:
"+sr[1]+"
";
  str +="手机:
"+sr[2]+"
";
  str +="业务传真:
"+sr[3]+"
";
  str +="Email:
"+sr[4]+"
";
  str +="QQ:
"+sr[5]+"
";
  str +="MSN:
"+sr[6]+"
";
  str +="
";
            div2.innerHTML=str;
            document.getElementById("divps").appendChild(div2);
  }
  
  
  function divClose()
  {
   if(document.getElementById('div3')!=null)
          {
            var div21="div3";
          RemoveDiv(div21);
          }
  }
  
  function RemoveDiv(obj)
        {
        var ob = document.getElementById(obj);  
         ob.parentNode.removeChild(ob);
        }
       

你可能感兴趣的:(常用代码积累)