分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

<jquery>基本的模态框

发布时间:2023-09-06 02:34责任编辑:郭大石关键词:暂无标签
<!DOCTYPE html><html lang="en"><head> ???<meta charset="UTF-8"> ???<title>自定义模态</title> ???<style> ???????.cover { ???????????position: absolute; ???????????background-color: rgba(0, 0, 0, 0.4); ???????????top: 0; ???????????right: 0; ???????????left: 0; ???????????bottom: 0; ???????????z-index: 998; ???????} ???????.modal { ???????????height: 400px; ???????????width: 600px; ???????????background-color: white; ???????????position: absolute; ???????????top: 50%; ???????????left: 50%; ???????????margin-left: -300px; ???????????margin-top: -200px; ???????????z-index: 1000; ???????} ???????.hide { ???????????display: none; ???????} ???</style></head><body><button id="b1">屠龙宝刀,点击就送</button><button id="b2">油腻的师姐,在哪里</button><div class="cover hide"></div><div class="modal hide"> ???<form action=""> ???????<p> ???????????<label for="">用户名: ???????????????<input type="text"> ???????????</label> ???????</p> ???????<p> ???????????<label for="">密码: ???????????????<input type="password"> ???????????</label> ???????</p> ???????<p> ???????????<input type="submit" value="登录"> ???????????<input id="cancel" type="button" value="取消"> ???????</p> ???</form></div><script src="jquery-3.2.1.min.js"></script><script> ???//找出标签 ???$("#b1,#b2").click(function () { ???????//把cover和modal展示出来 ???????$(".cover").removeClass("hide"); ???????$(".modal").removeClass("hide"); ???}) ???$("#cancel").click(function () { ???????$(".cover").addClass("hide"); ???????$(".modal").addClass("hide"); ???})</script></body></html>

  

<jquery>基本的模态框

原文地址:https://www.cnblogs.com/shuimohei/p/10502736.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved