如何打造小程序中独特且实用的自定义模态框?

2026-04-06 12:241阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计217个文字,预计阅读时间需要1分钟。

如何打造小程序中独特且实用的自定义模态框?

javascript/* 简化版伪创新开头内容 */.modal-mask { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background:

JS部分

/*=============== */ .modal-mask { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: #000; opacity: 0.5; overflow: hidden; z-index: 5; color: #fff; } .modal-dialog { width: 540rpx; overflow: hidden; position: fixed; top: 20%; left: 0; z-index: 7; background: #f9f9f9; margin: -180rpx 105rpx; border-radius: 4rpx; } .modal-content { padding: 50rpx; display: flex; flex-flow: column; width: auto; height: 850rpx; overflow-y: scroll; } /* 个人签名的弹窗 */ .sign-dialog { width: 540rpx; overflow: hidden; position: fixed; top: 40%; left: 0; z-index: 7; background: #f9f9f9; margin: -180rpx 105rpx; border-radius: 4rpx; } .modal-footer { height: 86rpx; font-size: 34rpx; line-height: 86rpx; } .btn-cancel { float: right; margin-right: 60rpx; color: #ff5983; text-align: center; } .btn-confirm { float: right; margin-right: 60rpx; color: #ff5983; text-align: center; } HTML部分

系统正在升级中,敬请期待 确定

如何打造小程序中独特且实用的自定义模态框?

本文共计217个文字,预计阅读时间需要1分钟。

如何打造小程序中独特且实用的自定义模态框?

javascript/* 简化版伪创新开头内容 */.modal-mask { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background:

JS部分

/*=============== */ .modal-mask { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: #000; opacity: 0.5; overflow: hidden; z-index: 5; color: #fff; } .modal-dialog { width: 540rpx; overflow: hidden; position: fixed; top: 20%; left: 0; z-index: 7; background: #f9f9f9; margin: -180rpx 105rpx; border-radius: 4rpx; } .modal-content { padding: 50rpx; display: flex; flex-flow: column; width: auto; height: 850rpx; overflow-y: scroll; } /* 个人签名的弹窗 */ .sign-dialog { width: 540rpx; overflow: hidden; position: fixed; top: 40%; left: 0; z-index: 7; background: #f9f9f9; margin: -180rpx 105rpx; border-radius: 4rpx; } .modal-footer { height: 86rpx; font-size: 34rpx; line-height: 86rpx; } .btn-cancel { float: right; margin-right: 60rpx; color: #ff5983; text-align: center; } .btn-confirm { float: right; margin-right: 60rpx; color: #ff5983; text-align: center; } HTML部分

系统正在升级中,敬请期待 确定

如何打造小程序中独特且实用的自定义模态框?