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,709
    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 11: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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13155 seconds
  • Memory Usage 2,864KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (2)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates