js仿百度弹出登录框可以拖拽
发表日期: 2020-08-01 11:15:43 浏览次数:107
醴陵百度爱采购网站推广电话、醴陵百度爱采购广告收费标准多少钱、醴陵百度爱采购代理服务商找哪家好、醴陵百度爱采购会员费一年需要多少钱、醴陵百度爱采购商家服务如何推广【醴陵百度爱采购广告推广咨询服务】
醴陵市,为湖南省辖县级市,由株洲市代管,地处湖南省东部,总面积2156.46平方千米,醴陵市东邻江西省萍乡市湘东区、上栗县,北接浏阳市,西倚株洲市芦淞区、渌口区,南界攸县。截至2018年末,醴陵市辖19镇、4街道办事处、1个经济开发区、1个示范区,户籍人口105.3万。
醴陵市拥有渌江书院、宋名臣祠、醴泉古井、状元芳洲、文笔奇峰、云岩寺等名胜古迹。醴陵市境内浙赣复线横贯东西,醴(陵)茶(陵)线连通南北,距株洲站仅40千米,沪昆高铁、沪昆高速、106国道、320国道纵横交错,市区距长沙黄花国际机场90千米。
2019年,醴陵市实现地区生产总值716.4亿元,实现财政总收入72.92亿元。
js仿百度弹出登录框可以拖拽
新建html文档。
书写html。
<div class="link"> <a href="javascript:showDialog();">登录</a> </div>
<div class="ui-mask" id="mask" onselectstart="return false"></div>
<div class="ui-dialog" id="dialogMove" onselectstart='return false;'>
<div class="ui-dialog-title" id="dialogDrag" onselectstart="return false;" > 登录通行证 <a class="ui-dialog-closebutton" href="javascript:hideDialog();"></a> </div>
<div class="ui-dialog-content">
<div class="ui-dialog-l40 ui-dialog-pt15">
<input class="ui-dialog-input ui-dialog-input-username" type="input" placeholder="手机/邮箱/用户名" value="" />
</div>
<div class="ui-dialog-l40 ui-dialog-pt15">
<input class="ui-dialog-input ui-dialog-input-password" type="input" placeholder="密码" value="" />
</div>
<div class="ui-dialog-l40"> <a href="#">忘记密码</a> </div>
<div> <a class="ui-dialog-submit" href="#" >登录</a> </div>
<div class="ui-dialog-l40"> <a href="#">立即注册</a> </div>
</div>
</div>
书写css样式。
<style type="text/css">
body { background: url(images/baidu_demo.png) #fff top center no-repeat; padding: 0px; margin: 0px; font-size: 12px; font-family: "微软雅黑"; }
.link { text-align: right; line-height: 20px; padding-right: 40px; }
.ui-dialog { width: 380px; height: auto; display: none; position: absolute; z-index: 9000; top: 0px; left: 0px; border: 1px solid #D5D5D5; background: #fff; }
.ui-dialog a { text-decoration: none; }
.ui-dialog-title { height: 48px; line-height: 48px; padding: 0px 20px; color: #535353; font-size: 16px; border-bottom: 1px solid #efefef; background: #f5f5f5; cursor: move; user-select: none; }
.ui-dialog-closebutton { width: 16px; height: 16px; display: block; position: absolute; top: 12px; right: 20px; background: url(images/close_def.png) no-repeat; cursor: pointer; }
.ui-dialog-closebutton:hover { background: url(images/close_hov.png); }
.ui-dialog-content { padding: 15px 20px; }
.ui-dialog-pt15 { padding-top: 15px; }
.ui-dialog-l40 { height: 40px; line-height: 40px; text-align: right; }
.ui-dialog-input { width: 100%; height: 40px; margin: 0px; padding: 0px; border: 1px solid #d5d5d5; font-size: 16px; color: #c1c1c1; text-indent: 25px; outline: none; }
.ui-dialog-input-username { background: url(images/input_username.png) no-repeat 2px; }
.ui-dialog-input-password { background: url(images/input_password.png) no-repeat 2px; }
.ui-dialog-submit { width: 100%; height: 50px; background: #3b7ae3; border: none; font-size: 16px; color: #fff; outline: none; text-decoration: none; display: block; text-align: center; line-height: 50px; }
.ui-dialog-submit:hover { background: #3f81b0; }
.ui-mask { width: 100%; height: 100%; background: #000; position: absolute; top: 0px; height: 0px; z-index: 8000; opacity: 0.4; filter: Alpha(opacity=40); }
</style>
书写js特效。
<script type="text/javascript">
var dialogInstace , onMoveStartId , mousePos = {x:0,y:0};
function g(id){return document.getElementById(id);}
function autoCenter( el ){
var bodyW = document.documentElement.clientWidth;
var bodyH = document.documentElement.clientHeight;
var elW = el.offsetWidth;
var elH = el.offsetHeight;
el.style.left = (bodyW-elW)/2 + 'px';
el.style.top = (bodyH-elH)/2 + 'px';
}
function fillToBody( el ){
el.style.width = document.documentElement.clientWidth +'px';
el.style.height = document.documentElement.clientHeight + 'px';
}
function Dialog( dragId , moveId ){
var instace = {} ;
instace.dragElement = g(dragId);
instace.moveElement = g(moveId);
instace.mouseOffsetLeft = 0;
instace.mouseOffsetTop = 0;
instace.dragElement.addEventListener('mousedown',function(e){
var e = e || window.event;
dialogInstace = instace;
instace.mouseOffsetLeft = e.pageX - instace.moveElement.offsetLeft ;
instace.mouseOffsetTop = e.pageY - instace.moveElement.offsetTop ;
onMoveStartId = setInterval(onMoveStart,10);
return false;
})
return instace;
}
document.onmouseup = function(e){
dialogInstace = false;
clearInterval(onMoveStartId);
}
document.onmousemove = function( e ){
var e = window.event || e;
mousePos.x = e.clientX;
mousePos.y = e.clientY;
e.stopPropagation && e.stopPropagation();
e.cancelBubble = true;
e = this.originalEvent;
e && ( e.preventDefault ? e.preventDefault() : e.returnValue = false );
document.body.style.MozUserSelect = 'none';
}
function onMoveStart(){
var instace = dialogInstace;
if (instace) {
var maxX = document.documentElement.clientWidth - instace.moveElement.offsetWidth;
var maxY = document.documentElement.clientHeight - instace.moveElement.offsetHeight ;
instace.moveElement.style.left = Math.min( Math.max( ( mousePos.x - instace.mouseOffsetLeft) , 0 ) , maxX) + "px";
instace.moveElement.style.top = Math.min( Math.max( ( mousePos.y - instace.mouseOffsetTop ) , 0 ) , maxY) + "px";
}
}
function showDialog(){
g('dialogMove').style.display = 'block';
g('mask').style.display = 'block';
autoCenter( g('dialogMove') );
fillToBody( g('mask') );
}
function hideDialog(){
g('dialogMove').style.display = 'none';
g('mask').style.display = 'none';
}
window.onresize = showDialog;
Dialog('dialogDrag','dialogMove');
showDialog();
</script>
查看效果
根据 DigiTimes 的最新报告,今年将会推出的 Apple Watch Series 6 会将血氧监测功能添加到其功能中。
再有消息称苹果Apple Watch Series 6支持血氧监测
报道指出,知情人士透露 Apple Watch Series 6 将配备可监测睡眠状况、血氧、脉搏、心跳和心房颤动的生物传感器,还将结合基于 MEMS 的加速度计和陀螺仪,所有这些新技术将使 Apple Watch 继续在可穿戴设备中保持领先。
由于苹果与台湾日月光技术公司之间的密切合作,下一代 Apple Watch 已经在 “平稳开发中”,该公司已经获得了 Apple Watch 的主要订单。
醴陵百度爱采购网站推广电话、醴陵百度爱采购广告收费标准多少钱、醴陵百度爱采购代理服务商找哪家好、醴陵百度爱采购会员费一年需要多少钱、醴陵百度爱采购商家服务如何推广【醴陵百度爱采购广告推广咨询服务】