Login.js:
Código Javascript:
Ver original
function login(){ my_popup.alert('Identificarme'); my_popup.cargando(); my_popup.buttons_clean(); $.ajax({ type: 'POST', url: '/login.php?data=login', data: 'id=1', success: function(h){ switch(trim(h).charAt(0)){ case '1': my_popup.end_loading(); my_popup.buttons_clean(); my_popup.status('ok'); my_popup.mensaje(trim(h).substring(3)); }} }); } //trim function 1.0 function trim(myString) { return myString.replace(/^\s+/g,'').replace(/\s+$/g,'') } //Presets! $(document).ready(function() { $('#muro_this_group').autoResize({ onResize : function() { }, animateDuration : 300, extraSpace : 1, limit: 150, }); }); (function(a){a.fn.autoResize=function(j){ var b=a.extend({ onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j); this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).attr('tabIndex','-1').insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery); // efecto zumbido! 0.1 by j0n4th4ntub3! (function($){ $.fn.zumbar = function(options){ var configs = $.extend({ velocidad: 60, cantidad: 2, duracion: 3, }, options); var positionin = $(this).position(); var widthel = $(this).innerWidth(); var Heightel = $(this).innerHeight(); if($(this).css('position') == 'static'){ $(this).css('position','absolute'); $(this).wrap('<div id="buzz" style="width:'+widthel+'px; height:'+Heightel+'px;"></div>'); } for(var i=0; i < this.length; i++){ for (c = 0; c <= configs.duracion ;c++){ $(this[i]).animate({top: positionin.top - configs.cantidad,}, configs.velocidad) .animate({left: positionin.left - configs.cantidad,}, configs.velocidad) .animate({top: positionin.top + configs.cantidad,},configs.velocidad) .animate({left: positionin.left + configs.cantidad,}, configs.velocidad) .animate({top: positionin.top,},configs.velocidad) .animate({left: positionin.left},configs.velocidad); }} }; })(jQuery); function sleep (seconds) { var start = new Date().getTime(); while (new Date() < start + seconds*1000) {} return 0; } /*My popup 1.0 Autor: j0n4th4ntub3*/ var my_popup = { //configuraciones... easy_close: true, close_with_btn: false, with_footer: false, //show! mostramos el popup! show: function(){ //centro el div calculando aproximadamente la pantalla. if($('#mypopup').height() > $(window).height()-60) $('#mypopup').css({'position':'absolute', 'top':20}); else $('#mypopup').css('top', $(window).height()/2 - $('#mypopup').height()/2 - 200); $('#mypopup').css('left', $(window).width()/2 - $('#mypopup').width()/2); //agregemos lo elemental al popup if($('#mypopup').html() == ''){ $('#mypopup').html('<div id="popup"><div id="Closepopup"></div><div class="title"></div><div id="mypopup-content"><div id="loading_popup"></div><div class="mypopup-content2" id="mensaje_mypopup"></div><div id="bottom_popup"></div><div id="footer"></div></div>'); } //easy close activado (?) if(this.easy_close){ $('#mascara').click(function(){my_popup.close(); }); } //easy close no activado! else{ this.close_with_btn = true; $('#mascara').unbind('click');} // necesitamos cerrar el popup con un boton (?) if(this.close_with_btn || this.easy_close == true){ $('#Closepopup').append('<a class="close_pop" onclick="my_popup.close();"></a>'); } else $('#Closepopup .close_pop').remove(); //requerimos el footer. ? if(this.with_footer){ $('#footer').append('<div class="footer" id="footer_mypopup"></div>'); } //tamaño de la mascara segun la pantalla $('#mascara').css({ 'width':$(document).width(), 'height':$(document).height() + 150, 'display':'block' }); //mostramos mypopup $('#mypopup').fadeIn('fast'); }, titulo: function(title){ $('#mypopup .title').html(title); }, mensaje: function(msg){ $('#mensaje_mypopup').html(msg); }, footer: function(txt){ $('#footer_mypopup').html(txt); }, css: function(style){ $('#mypopup').addClass(style); $('#buttons').addClass(style); }, center: function(){ }, status: function(stat){ switch(stat){ case 'ok': $('#mensaje_mypopup').css('color','green').css('font-weight','bold'); break; case 'error': $('#mensaje_mypopup').css('color','red').css('font-weight','bold'); break; } }, close: function(){ //Reset! this.easy_close = true; this.close_with_btn = false; this.with_footer = false; //mascara off $('#mascara').css('display','none'); //mypopup off $('#mypopup').fadeOut("fast"); //contenido removido! $('#mypopup #popup').fadeOut("fast",function(){ $(this).remove();}); }, buttons: function(val,func,inthisfunc,alls,reload){ if(!inthisfunc){ if(alls){ $('#bottom_popup').append('<div id="buttons"></div>'); $('#buttons').append('<input type="button" class="popbuttons" value="' + val + '"' + ' onclick="' + (reload ? 'location.reload()' : func )+ '">'); } else{ $('#buttons').append('<input type="button" class="popbuttons" value="' + val + '"' + ' onclick="' + (reload ? 'location.reload()' : func )+ '">'); } } else if(inthisfunc){ $('#bottom_popup').append('<div id="buttons"><input type="button" class="popbuttons" value="' + val + '"' + ' onclick="my_popup.' + func + '"></div>'); } }, buttons_clean: function(){ $('#buttons').html(''); }, alert: function (title,msg){ this.show(); this.titulo(title); this.mensaje(msg); this.buttons('Aceptar','close()'); }, cargando: function(){ $('#mypopup #loading_popup').css('display','block');}, end_loading: function(){ $('#mypopup #loading_popup').css('display','none');} }
Gracias y espero su respuesta y q me puedan dar una solucion.