Guest User

Untitled

a guest
Nov 17th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){
  2.  
  3. var contactForm = {
  4.  
  5.     container: $('#contact'),
  6.  
  7.     init: function(){
  8.         $('<button></button>',{
  9.             text: 'Contact Me'
  10.         })
  11.             .insertAfter('article:first')
  12.             .on('click', this.show);
  13.     },
  14.  
  15.     show: function(){
  16.         contactForm.close.call(contactForm.container);
  17.         contactForm.container.show();
  18.     },
  19.  
  20.     close: function(){
  21.         var $this = $(this);
  22.         $('<span class=close>X</span>')
  23.             .prependTo(this)
  24.             .on('click', function(){
  25.                 $this.hide();
  26.             })
  27.     }
  28.  
  29. };
  30.  
  31. contactForm.init();
  32.  
  33. })();
Add Comment
Please, Sign In to add comment