新手,请教这种效果是不是用jquery做出来的。请问方法
新手,请问这种效果是不是用jquery做出来的。请教方法
http://t.ifeng.com/
这是凤凰网的微博。 在主页登陆随便输入个名字密码。
在浏览器上方会弹出一个密码错误的提示。请问这种效果是怎么做出来的。
求大大们指导。。。。
------解决方案--------------------
http://t.ifeng.com/
这是凤凰网的微博。 在主页登陆随便输入个名字密码。
在浏览器上方会弹出一个密码错误的提示。请问这种效果是怎么做出来的。
求大大们指导。。。。
------解决方案--------------------
- JScript code
function floatDoLogin() { var sUsername = $.trim($('#floatLoginName').val()); var sPwd = $('#floatLoginPwd').val(); if(sUsername == '') { floatLoginTishi('请输入用户名'); return false; }else if(sPwd == ''){ floatLoginTishi('请输入密码'); return false; }else { $.getJSON( __GLOBAL_VARS.SYS_PATH_WEB + '/?_c=account&_a=doLogin&callback=?', { loginusername: sUsername, password: sPwd, remember: '1', handler:'jsonHandler' }, function(json){ if(json.code < 0 ) { floatLoginTishi(json.data); }else { floatLoginTishi('登录成功'); window.location.reload(); } } ); } }
------解决方案--------------------
<head>
<script type="text/javascript">
var t="";
var s=false;
function change(){
var ti="";
var div=document.getElementById("test");
var c=0;
if(parseInt(div.style.height)<=0){
t=true;
}else if(parseInt(div.style.height)>=20){
t=false;
s=true;
}
if(t){
c=1;
}else{
c=-1;
}
div.style.height=parseInt(div.style.height)+c+"px";
ti=window.setTimeout(change,100);
if(s&&t){
s=false;
window.clearTimeout(ti);
}
}
</script>
</head>
<body>
<div id="test" style="position:absolute;left:0px;height:0px;width:1000px;top:0px;overflow:hidden" align="center">error</div>
<input type="button" onClick="change()" value="change">
</body>
这样试试