Skip to main content

jQuery Twitter Style Login Window

By Sam Deering

JavaScript

Share:

Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

twitter-style-login-window

I will show you how to add a really cool twitter style login window to your website. It’s pretty simple just follow these 3 steps:

  1. Enter the jQuery code below into your JavaScript include
  2. Enter the HTML code below to create the form and login button
  3. Edit your CSS file to get the look and feel you want for your website

See Live Demo

jQuery(document).ready(function($) {
    $(".signin").click(function(e) {          
		e.preventDefault();
        $("fieldset#signin_menu").toggle();
		$(".signin").toggleClass("menu-open");
    });
	
	$("fieldset#signin_menu").mouseup(function() {
		return false
	});
	$(document).mouseup(function(e) {
		if($(e.target).parent("a.signin").length==0) {
			$(".signin").removeClass("menu-open");
			$("fieldset#signin_menu").hide();
		}
	});	
});

Enter this code into your html:

Sign in  
  
    
      Email
      
      
      
        Password
        
      
      
        
        
        Remember me
      
       Forgot your password? 
    
  

This is an example of the CSS: FRONT.CSS

Any questions about this feel free to contact me!

Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

New books out now!

Get practical advice to start your career in programming!


Master complex transitions, transformations and animations in CSS!