www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to get a pop-up message with login form.

  1. #1
    Join Date
    Jan 2014
    Posts
    5

    How to get a pop-up message with login form.

    Hi friends,

    There are websites with one sign-in button. When we click on the button it displays a pop-up with fields to login. How can I get that type of pop-ups integrated in my website?
    Example: Visit this: http://alumni.ipec.org.in/ website and click on sign-in.

    Also here is a screenshot: http://www.zimagez.com/zimage/screen...4-072025pm.php

  2. #2
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,681
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <style type="text/css">
    /*<![CDATA[*/
    
    #login {
     position:absolute;z-Index:110;visibility:hidden;background-color:lightyellow;width:350px;height:120px;padding: 4px;border:9px solid black;
    }
    
    .mask {
     z-Index:101;background-Color:#000000;
     opacity: .5;filter: alpha(opacity=50);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
    }
    
    /*]]>*/
    </style></head>
    
    <body>
    <input type="button" name="" value="LogIn" onmouseup="zxcPopUp.Open('login',true,1000,'C','mask');"/>
    <div id="login" >
     My Login Form<br />
     <br />
     <br />
    <input type="button" name="" value="close" onmouseup="zxcPopUp.Open('login',false);"
    </div>
    
    <script type="text/javascript">
    /*<![CDATA[*/
    // Simple Clip Pop Up (20-January-2014)
    // by Vic Phillips - http://www.vicsjavascripts.org/
    
    
    var zxcPopUp={
     // id   = the unique ID name of the Pop Up.             (string)
     // ms   = (optional) the animation duration in millsec. (number, default = 1000)
     // clip = (optional) the clip type.                     (string, default = C = center)
     //                   C = center, H = horizontal, V = vertical,  R = right, L = left, D = down, U = up
     // mask = (optional) the class name of the mask.        (string, default = no mask)
    
     Open:function(id,ud,ms,clip,mask){
      var oop=this,pop=document.getElementById(id);
      if (pop&&!this['zxc'+id]){
       var o={},w,h;
       o.ms=typeof(ms)=='number'&&ms>20?ms:1000;
       o.msk=document.createElement('DIV');
       o.msk.style.position='fixed';
       o.msk.style.visibility='hidden';
       o.msk.style.width=o.msk.style.height=o.msk.style.bottom=o.msk.style.right='0px';
       o.mk=o.msk.cloneNode(false);
       o.msk.className=mask;
       document.body.appendChild(o.msk);
       document.body.appendChild(o.mk);
       o.msk.style.width='100%';
       o.w=pop.offsetWidth;
       o.h=pop.offsetHeight;
       h=Math.round(o.h/2);
       w=Math.round(o.w/2);
       o.mde=Math.max(clip?('CHVRLDU').indexOf(clip.charAt(0).toUpperCase()):0,0);
       o.mds=[[0,h,w,h,w],[0,0,w,o.h,w],[0,h,o.w,h,0],[0,0,0,o.h,0],[0,0,o.w,o.h,o.w],[0,0,o.w,0,0],[0,o.h,o.w,o.h,0]];
       o.pop=[pop,'clip',o.mds[o.mde].concat(),[100,0,o.w,o.h,0],o.mds[o.mde].concat()];
       o.ud=!ud;
       this['zxc'+id]=o;
       this.addevt(o.msk,'mouseup','open',id,false);
       this.addevt(window,'resize','resize',o);
      }
      if (this['zxc'+id]){
       this.open(id,ud);
      }
     },
    
     open:function(id,ud){
      var o=this['zxc'+id],ud=typeof(ud)=='boolean'?ud:false;
      if (o&&ud!=o.ud){
       o.msk.style.visibility=o.pop[0].style.visibility='visible';
       this.resize(o);
       this.animate(o,o.pop,o.pop[4].concat(),o.pop[ud?3:2],new Date(),o.ms*Math.abs((o.pop[4][0]-(ud?100:0))/100)+5,ud);
       o.ud=ud;
      }
     },
    
     resize:function(o){
      o.pop[0].style.left=(o.mk.offsetLeft-o.w)/2+'px';
      o.pop[0].style.top=(o.mk.offsetTop-o.h)/2+'px';
      o.msk.style.height=o.mk.offsetTop+'px';
     },
    
     animate:function(o,a,f,t,srt,mS,ud){
      clearTimeout(a[7]);
      var oop=this,ms=new Date()-srt,n,z0=0;
      for (;z0<t.length;z0++){
       n=(t[z0]-f[z0])/mS*ms+f[z0];
       a[4][z0]=Math.max(Math.round(isFinite(n)?n:a[4][z0]),0);
      }
      oop.clip(a,a[4]);
      if (ms<mS){
       a[7]=setTimeout(function(){ oop.animate(o,a,f,t,srt,mS,ud); },10);
      }
      else {
       ud===false?a[0].style.visibility=o.msk.style.visibility='hidden':null;
       oop.clip(a,t);
      }
     },
    
     clip:function(a,t){
      a[0].style.clip='rect('+t[1]+'px,'+t[2]+'px,'+t[3]+'px,'+t[4]+'px)';
     },
    
     addevt:function(o,t,f,p,p1){
      var oop=this;
      o.addEventListener?o.addEventListener(t,function(e){ return oop[f](p,p1);},false):o.attachEvent?o.attachEvent('on'+t,function(e){ return oop[f](p,p1); }):null;
     }
    
    
    };
    /*]]>*/
    </script>
    </body>
    
    </html>
    Last edited by vwphillips; 01-20-2014 at 10:28 AM.
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles