温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:仿迅雷博客弹出登录窗口
当前文件:
XunleiLogin/Default.aspx[5K,2009-6-12 12:00:21],打开代码结构图
XunleiLogin/Default.aspx[5K,2009-6-12 12:00:21],打开代码结构图1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head id="Head1" Runat="Server"> 7
<title>登录</title> 8
<style type="text/css"> 9
* { 10
padding: 0px; 11
margin: 0px; 12
font-family: Verdana, Arial, Helvetica, sans-serif; 13
} 14
html, body{ 15
text-align: center; 16
width: 100%; 17
font-size: 12px; 18
} 19
a:link, a:visited { 20
text-decoration: none; 21
} 22
a:hover{ 23
text-decoration:underline; 24
} 25
img { 26
border: 0px; 27
vertical-align:middle; 28
} 29
#loginform{ 30
display:inline; 31
} 32
#loginform span a{ 33
color:#FF0000; 34
font-weight:bold; 35
} 36
#floatDiv { 37
background: #EEF7FE; 38
border: 1px #B8D2F5 solid; 39
} 40
#headDiv{ 41
height:30px; 42
background-color:#E9F1FC; 43
cursor:move; 44
} 45
#headDiv span { 46
margin-right:6px; 47
margin-top:7px; 48
float:right; 49
} 50
#bodyDiv { 51
margin:0px 6px 6px 6px; 52
padding:10px; 53
background: #FFF; 54
border: 1px #D9E9F9 solid; 55
clear:both; 56
line-height:32px; 57
} 58
#bodyDiv a{ 59
color:#666; 60
} 61
#bodyDiv ul{ 62
width:200px; 63
color:#1973C1; 64
margin-bottom:6px; 65
vertical-align:middle; 66
} 67
#bodyDiv .tbx{ 68
border:1px #B7D1F4 solid; 69
width:125px; 70
height:18px; 71
} 72
#bodyDiv .code{ 73
border:1px #B7D1F4 solid; 74
width:60px; 75
height:18px; 76
} 77
</style> 78
<link href="login.css" rel="stylesheet" type="text/css" /> 79
<script type="text/javascript"> 80
function $(elem){ 81
return document.getElementById(elem); 82
} 83
function Login(isbackDiv){ 84
if($('floatDiv')==null){ 85
var floatDiv = document.createElement('div'); 86
floatDiv.id = "floatDiv"; 87
floatDiv.style.position = "absolute"; 88
floatDiv.style.width = 300 + "px"; 89
floatDiv.style.height = 200 + "px"; 90
floatDiv.style.left =(document.documentElement.clientWidth/2 + document.documentElement.scrollLeft - 150)+"px"; 91
floatDiv.style.top =(document.documentElement.clientHeight/2 + document.documentElement.scrollTop - 100)+"px"; 92
floatDiv.style.zIndex = 1001; 93
var loginText = "<iframe id=\"iframe1\" frameborder=\"0\" scrolling=\"no\" src=\"login.aspx\" width=\"100%\" height=\"200\"></iframe>"; 94
floatDiv.innerHTML = loginText; 95
document.body.appendChild(floatDiv); 96
} 97
else{ 98
$('floatDiv').style.display = "block"; 99
} 100
if($('backDiv')==null && isbackDiv ==true){ 101
var backDiv = document.createElement('div'); 102
backDiv.id = "backDiv"; 103
backDiv.style.backgroundColor = "Black"; 104
backDiv.style.filter = "alpha(opacity=70)"; 105
backDiv.style.MozOpacity = "0.70"; 106
backDiv.style.position = "absolute"; 107
backDiv.style.left = "0px"; 108
backDiv.style.top = "0px"; 109
backDiv.style.width = Math.max(document.body.scrollWidth, document.documentElement.clientWidth) +"px"; 110
backDiv.style.height = Math.max(document.body.scrollHeight, document.documentElement.clientHeight)+"px"; 111
document.body.appendChild(backDiv); 112
$('backDiv').style.zIndex = 1000; 113
} 114
else if(isbackDiv ==true){ 115
$('backDiv').style.display = "block"; 116
} 117
} 118
function moveDiv(event, elem) 119
{ 120
$('floatDiv').style.filter = "alpha(opacity=50)"; 121
var oObj = $(elem); 122
oObj.onmousemove = mousemove; 123
oObj.onmouseup = mouseup; 124
oObj.setCapture ? oObj.setCapture() : function(){}; 125
oEvent = window.event ? window.event : event; 126
var dragData = {x : oEvent.clientX, y : oEvent.clientY}; 127
var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)}; 128
function mousemove() 129
{ 130
var oEvent = window.event ? window.event : event; 131
var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left); 132
var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top); 133
oObj.style.left = iLeft; 134
oObj.style.top = iTop; 135
dragData = {x: oEvent.clientX, y: oEvent.clientY}; 136
} 137
function mouseup() 138
{ 139
var oEvent = window.event ? window.event : event; 140
oObj.onmousemove = null; 141
oObj.onmouseup = null; 142
$('floatDiv').style.filter = ""; 143
if(oEvent.clientX < 1 || oEvent.clientY < 1) 144
{ 145
oObj.style.left = backData.y; 146
oObj.style.top = backData.x; 147
} 148
oObj.releaseCapture ? oObj.releaseCapture() : function(){}; 149
} 150
} 151
function CloseFloatDiv(){ 152
$('floatDiv').style.display = "none"; 153
if($('backDiv')){ 154
$('backDiv').style.display = "none"; 155
} 156
} 157
</script> 158
</head> 159
<body style="margin: 0 0 0 0;"> 160
<form id="form1" Runat="Server"> 161
<div id="loginform"><a href="#" onclick="javascript:Login(true);">用户登陆</a></div> 162
</form> 163
</body> 164
</html> 165





*
padding
