Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ia = {
- mc: 1,
- m: function(content, div) {
- ia.mc++;
- $('#m' + ia.mc + ' div:first-child').text(content);
- if (div) {
- $('#m' + ia.mc).css({left: $(div).offset().left - $('.message').width() + $(div).width() - 30, top: $(div).offset().top - 25});
- }
- $('#m' + ia.mc).fadeIn().delay(3000).fadeOut(400, function() { ia.m--; });
- }
- }
- var iaLogin = {
- init: function() {
- $('.login input').keyup(function(event) { event.keyCode == 13 ? iaLogin.submit() : ''; });
- $('.submit input').click(function() { iaLogin.submit(); });
- $('#user').focus();
- },
- submit: function() {
- var inputs = {};
- $('.login :input[type=text],.login :input[type=password]').each(function() {
- inputs[this.name] = this.value;
- });
- $.get('/ajx/login.php', inputs, function(d) {
- if (d.errors) {
- $.each(d.errors, function(i, v) { ia.m(v, i); });
- }
- }, 'json');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement