js响应式模态框弹出动画代码



202 806 269



特效描述:js 响应式模态框 弹出动画,js svg点击按钮事件弹出模态框动画效果,支持响应式的模态框代码。

代码结构

1. 引入CSS

<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/style.css">

2. 引入JS

<script src="js/index.js"></script>

3. HTML代码

<div class="demo-btns">
  <header>
    <h1>响应式模态框</h1>
  </header>
  <div class="info">
    <div class="buttons">
      <p> <a href="" data-modal="#modal" class="modal__trigger">演示 1</a> <a href="" data-modal="#modal2" class="modal__trigger">演示 2</a> <a href="" data-modal="#modal3" class="modal__trigger">演示 3</a> </p>
    </div>
    <p>单击按钮激活模式。<br>
  </div>
</div>
<!-- Modal -->
<div id="modal" class="modal modal__bg" role="dialog" aria-hidden="true">
  <div class="modal__dialog">
    <div class="modal__content">
      <h1>Modal</h1>
      <p>Church-key American Apparel trust fund, cardigan mlkshk small batch Godard mustache pickled bespoke meh seitan. Wes Anderson farm-to-table vegan, kitsch Carles 8-bit gastropub paleo YOLO jean shorts health goth lo-fi. Normcore chambray locavore Banksy, YOLO meditation master cleanse readymade Bushwick.</p>
      <!-- modal close button --> 
      <a href="" class="modal__close demo-close">
      <svg class="" viewBox="0 0 24 24">
        <path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"/>
        <path d="M0 0h24v24h-24z" fill="none"/>
      </svg>
      </a> </div>
  </div>
</div>
<div id="modal2" class="modal modal--align-top modal__bg" role="dialog" aria-hidden="true">
  <div class="modal__dialog">
    <div class="modal__content">
      <h1>Big Modal</h1>
      <h3>This modal is pretty tall.</h3>
      <p>Selfies normcore four dollar toast four loko listicle artisan. Hoodie Marfa authentic, wayfarers church-key tofu Banksy pop-up Kickstarter Brooklyn heirloom swag synth. Echo Park cray synth mixtape. Tofu gastropub squid readymade, trust fund Wes Anderson DIY PBR 8-bit try-hard +1 Shoreditch lo-fi tote bag.</p>
      <p><img src="http://unsplash.it/600/300" alt="" /></p>
      <p>Mumblecore cred selfies fingerstache. Tousled skateboard plaid lo-fi shabby chic salvia, swag Odd Future Etsy art party Austin cronut. Crucifix whatever Pinterest food truck, pickled viral cray 90's DIY chambray keffiyeh biodiesel Vice blog. Cred meh yr tofu.</p>
      <p>Mumblecore cred selfies fingerstache. Tousled skateboard plaid lo-fi shabby chic salvia, swag Odd Future Etsy art party Austin cronut. Crucifix whatever Pinterest food truck, pickled viral cray 90's DIY chambray keffiyeh biodiesel Vice blog. Cred meh yr tofu.</p>
      <!-- modal close button --> 
      <a href="" class="modal__close demo-close">
      <svg class="" viewBox="0 0 24 24">
        <path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"/>
        <path d="M0 0h24v24h-24z" fill="none"/>
      </svg>
      </a> </div>
  </div>
</div>
<div id="modal3" class="modal modal__bg" role="dialog" aria-hidden="true">
  <div class="modal__dialog">
    <div class="modal__content">
      <h1>Modal 3</h1>
      <p>Church-key American Apparel trust fund, cardigan mlkshk small batch Godard mustache pickled bespoke meh seitan. Wes Anderson farm-to-table vegan, kitsch Carles 8-bit gastropub paleo YOLO jean shorts health goth lo-fi.</p>
      <!-- modal close button --> 
      <a href="" class="modal__close demo-close">
      <svg class="" viewBox="0 0 24 24">
        <path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"/>
        <path d="M0 0h24v24h-24z" fill="none"/>
      </svg>
      </a> </div>
  </div>
</div>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 右键菜单 html5动画导航菜单 图片头像上传 文字标签 文字提示框 html5图片动画 文件上传 彩色文字 提示框/弹出层 html5文字动画 文本框 文字闪烁 layer 下拉框 打字机 html5表情动画 lightbox 复选 文字列表 html5线条动画 单选 Tooltip工具提示框 文字弹幕 登录框 浮动提示框 html5飘落动画 文字高亮 注册框 html5弹窗动画 html5光标动画 搜索框 验证码 html5悬停动画 二级联动 三级联动 城市选择 value赋值 筛选 按钮控制 购物车 颜色选择 表单提交 全选/反选 添加删除 添加标签 密码强度验证 表单验证 html5按钮动画 按钮样式 密码修改设置 文字叠加 文字拖动 文字提示框 文字收缩展开 文字放大缩小 文字翻转旋转 加载动画 文字淡出淡进 文字全屏 文字延迟加载 360全景 html5文字动画 文字滚动 文字滑动 文字切换 弹出层拖动 窗口提示框 html5弹窗动画 图片文字 文字导航菜单 切换按钮 html5动画h5动画 form表单 文字 html5按钮动画

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到