登陆程序代码求助,还有兼容问题。

物理学弟 2013-08-07 05:06:31
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>弹出登录框的实现代码</title>
</head>
<body>
<style type="text/css">
body{
margin: 0px;
padding:0
}

#div1{
display: none;
position: absolute;
z-index: 1000;
height: 100%;
width: 100%;
background: #000000;
filter:Alpha(opacity=30);
}

#div2{
display: none;
position: absolute;
height: 100%;
width: 100%;
padding-top: 10%;
z-index: 1001;
left: 0px;
top: 0px;
}

</style>
<script>

function openme(){
document.getElementById('div1').style.display='block';
document.getElementById('div2').style.display='block';
}

function closeme(){
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='none';
}

function logo_in(){
alert()
//验证
//转向
//myform.action=""
//myform.submit()
closeme();
}
</script>

<div id="div1"></div>
<div id="div2">
<table width="30%" border="0" cellpadding="3" cellspacing="1" style="background: #ff7300; position:static;filter:progid:DXImageTransform.Microsoft.DropShadow(color=#666666,offX=4,offY=4,positives=true)" align="center">
<tr id="m_tr">
<td><font color="#FFFFFF">欢迎登陆:</font></td>
<td align="right">
<input type="button" value="x" onClick="closeme()" style="cursor: hand;">
</td>
</tr>
<tr>
<form name="myform" method="post" >
<td colspan="2" width="100%" bgcolor="#FFFFFF" height="150">
username: <input type="text" name="username" size="10">
<br>pasword:<input type="password" name="pasword" size="12">
<br><input type="button" name="logoin" value="登陆" onClick="logo_in()">
<input type="button" name="exit" value="取消" onClick="closeme()">
</td>
</form>
</tr>
</table>
</div>

<div>
<input name="button" type="button" onClick="openme()" value="登陆" align="center" />
</div>

</body>
</html>


①只在IE中能用,不兼容火狐与其他浏览器
filter:progid:DXImageTransform.Microsoft.DropShadow(color=#666666,offX=4,offY=4,positives=true)
这代码就IE能用,我还不太懂什么意思,请问别的浏览器如何实现这样的功能

②比如验证输入的用户和密码正确,如果后台有数据库,应该如何写代码?没写过,完全不会写。

③table width="30%"中的30%为什么去掉反而变小了?
<input name="button" type="button" onClick="openme()" value="登陆" align="center" />
还有这个的align="center"为什么无效?
...全文
129 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
物理学弟 2013-08-14
  • 打赏
  • 举报
回复
还有人能回答下吗?
物理学弟 2013-08-08
  • 打赏
  • 举报
回复
引用 4 楼 xiaofanku 的回复:
不断切换png图片实现不了吗?什么玩还要不断变化
用图片的话,那第一层的div1无法使用全屏,用css能改变大小,图片太麻烦了吧
街头小贩 2013-08-07
  • 打赏
  • 举报
回复
引用 3 楼 u011248375 的回复:
引用 2 楼 xiaofanku 的回复:
为什么不用ps作一张图呢?
那样阴影无法变化
不断切换png图片实现不了吗?什么玩还要不断变化
物理学弟 2013-08-07
  • 打赏
  • 举报
回复
引用 2 楼 xiaofanku 的回复:
为什么不用ps作一张图呢?
那样阴影无法变化
街头小贩 2013-08-07
  • 打赏
  • 举报
回复
1.阴影, 也不是所有ie浏览器版本都支持.我的ie10就不支持. 为什么不用ps作一张图呢?
似梦飞花 2013-08-07
  • 打赏
  • 举报
回复
2 根据用户名查出密码信息 对比一样的话返回成功 否则返回失败 3 width=30%是相对父元素的宽度而言的 去掉的话自己计算为容得下内容的最小宽度 貌似

87,965

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧