Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var ia = {
  2.  
  3.   mc: 1,
  4.  
  5.   m: function(content, div) {
  6.  
  7.     ia.mc++;
  8.  
  9.     $('#m' + ia.mc + ' div:first-child').text(content);
  10.  
  11.     if (div) {
  12.       $('#m' + ia.mc).css({left: $(div).offset().left - $('.message').width() + $(div).width() - 30, top: $(div).offset().top - 25});
  13.     }
  14.  
  15.     $('#m' + ia.mc).fadeIn().delay(3000).fadeOut(400, function() { ia.m--; });
  16.  
  17.   }
  18. }
  19.  
  20. var iaLogin = {
  21.  
  22.   init: function() {
  23.  
  24.     $('.login input').keyup(function(event) {  event.keyCode == 13 ? iaLogin.submit() : ''; });
  25.  
  26.     $('.submit input').click(function() { iaLogin.submit(); });
  27.  
  28.  
  29.     $('#user').focus();
  30.  
  31.   },
  32.  
  33.   submit: function() {
  34.  
  35.     var inputs = {};
  36.  
  37.     $('.login :input[type=text],.login :input[type=password]').each(function() {
  38.       inputs[this.name] = this.value;
  39.     });
  40.  
  41.     $.get('/ajx/login.php', inputs, function(d) {
  42.       if (d.errors) {
  43.         $.each(d.errors, function(i, v) { ia.m(v, i); });
  44.       }
  45.     }, 'json');
  46.  
  47.  
  48.   }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement