62,270
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" MaintainScrollPositionOnPostback="true" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>江中药谷碳排放系统 - 登录界面</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="JS/jquery-3.1.0.min.js"></script>
<link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="bootstrap-3.3.5-dist/css/bootstrap-theme.min.css" rel="stylesheet" />
<script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
<script src="bootstrap-3.3.5-dist/js/npm.js"></script>
<style type="text/css">
#warning {
font-family: 微软雅黑,宋体;
font-size: 12px;
color: red;
}
/*.code, #user_name, user_pwd {
font-size:15px;
}*/
#div_outer{
margin:10px auto;
width:6400px;
background-image:url(./IMG/login/loading.gif);
background-repeat:no-repeat;
overflow:hidden;
}
#div_innerMove {
position:relative;
}
#div_innerMove img {
margin:0px;
float:left;
}
.login {
width:240px;
background-color:#95c3ee;
border:1px solid #f2e6e6;
padding:6px 6px 6px 6px;
position:fixed;
top:580px;
right:300px;
}
#btn_left, #btn_right {
width:30px;
height:30px;
background-image:url(./IMG/login/back_btn_1.jpg);
border:1px solid #999;
border-radius:8px;
float:left;
}
#btn_right {
background-position:30px 0px;
margin:0px 0px 0px 1220px;
}
#div_controls {
position:relative;
top:-345px;
}
#Submit, #Reset {
border-radius:6px;
}
</style>
<script type="text/javascript">
function veritySubmit() {
var uname = document.getElementById("user_name").value;
if (uname == null || uname == "") {
document.getElementById("warning").textContent = "用户名不能为空!";
return false;
}
var upwd = document.getElementById("user_pwd").value;
if (upwd == null || upwd == "") {
document.getElementById("warning").textContent = "密码不能为空!";
return false;
}
var userPattern = /[A-Za-z0-9]{4,20}/;
var flag = userPattern.test(uname);
if (flag == false) {
document.getElementById("warning").textContent = "用户名只能由英文大小写字母组成!";
return false;
}
var pwdPattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,18}$/;
flag = pwdPattern.test(upwd);
if (flag == false) {
document.getElementById("warning").textContent = "密码必须由8-16位字母、数字、特殊符号线组成.!";
return false;
}
return true;
}
function Reset() {
document.getElementById("warning").textContent = "";
}
var img_now = 0;
var img_count = 5;
var img_every_width = 1280;
var t = setInterval("$('#btn_right').click()", 3000);
$(document).ready(function () {
$("#btn_left").click(function () {
img_now = (img_now + img_count - 1) % img_count;
moveto(img_now);
});
$("#btn_right").click(function () {
img_now = (img_now + 1) % img_count;
moveto(img_now);
});
$("#div_outer").mouseenter(function () {
$("#div_controls").fadeIn();
clearInterval(t);
});
$("#div_outer").mouseleave(function () {
$("#div_controls").fadeOut();
t = setInterval("$('#btn_right').click()", 3000);
});
});
function moveto(i) {
var _left = -(i * img_every_width);
$("#div_innerMove").animate({ "opacity": 0.6 }, 200);
$("#div_innerMove").animate({ "left": _left });
$("#div_innerMove").animate({ "opacity": 1 }, 200);
}
</script>
</head>
<body>
<form id="form1" runat="server" defaultbutton="Submit" defaultfocus="user_name">
<div class="container">
<h1><strong>保密一下哈~</strong></h1>
<hr />
<div class="img_login">
<div id="div_outer">
<div id="div_innerMove" runat="server">
<asp:Image ID="Image1" runat="server" ImageUrl="~/IMG/login/3000亩生态的江中药谷.jpg" />
<asp:Image ID="Image2" runat="server" ImageUrl="~/IMG/login/江中药谷培训接待中心.jpg" />
<asp:Image ID="Image3" runat="server" ImageUrl="~/IMG/login/镌刻68位中医药名家的药谷大门.jpg" />
<asp:Image ID="Image4" runat="server" ImageUrl="~/IMG/login/中药固体制剂生产线.jpg" />
<asp:Image ID="Image5" runat="server" ImageUrl="~/IMG/login/自然生态的江中药谷.jpg" />
</div>
<div id="div_controls">
<input id="btn_left" type="button" value="" />
<input id="btn_right" type="button" value="" />
<p style="clear:both"></p>
</div>
</div>
</div>
<div class="login">
用户名:<asp:TextBox ID="user_name" runat="server" Width="170px" Height="20px"></asp:TextBox>
<br />
<br />
密 码:<asp:TextBox ID="user_pwd" runat="server" TextMode="Password" Width="170px"
Height="20px"></asp:TextBox>
<br />
<br />
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div class="login_code">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
验证码:<asp:TextBox ID="code" runat="server" Width="45px" Height="20px"></asp:TextBox>
<asp:ImageButton ID="vcImage" runat="server" AlternateText="图片验证码"
ImageUrl="~/CreateCode.aspx" Style="vertical-align: middle" />
<asp:LinkButton runat="server" ID="refreshCode" OnClick="refreshCode_Click">
<span id="exchange" style="font-family:Verdana, Gabriola">换一张</span></asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="refreshCode" />
</Triggers>
</asp:UpdatePanel>
</div>
<asp:Label ID="warning" runat="server" Text=""></asp:Label>
<br />
<asp:Button ID="Submit" runat="server" Text="登录" OnClick="Submit_Click" OnClientClick="return veritySubmit()" />
<input id="Reset" type="reset" value="重置" onclick="Reset()" />
</div>
</div>
</form>
</body>
</html>
,万分感谢能得到一个完美的答案,拜谢!
#outter
{
width: 1000px;
overflow: hidden;
}
#inner
{
width: 6000px;
left: 700px;
position: relative;
}
<div style="overflow:hidden; width:500px; height:300px;">
<img src="图片.jpg" />
</div>