舒適的全屏式的彈窗jQuery插件 – animatedModal.js
animatedModal.js 是一個全屏式的彈窗jQuery插件,而且彈出效果很漂亮,全屏的彈窗特別適用于移動手機網站,所以做響應式網頁的設計師們可以嘗試使用這款插件。
animatedModal.js 的彈出動畫可以結合?animate.css 這個樣式庫來實現漂亮酷弦的動畫特效。
插件的min版只有2KB大小,對于普通站來這不算什么了,下面一起看看該彈窗代碼的DEMO效果,真很好看,扁平化的風格設計。
插件兼容性
- IE10+
- Chrome
- Firefox
- Safari
- Opera
使用教程
STEP1: 在<head>
內引入animate.css樣式庫
<head> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.min.css"> </head>
STEP2: HTML代碼:在<body>
內加入以下代碼
<body> <!--Call your modal--> <a id="demo01" href="#animatedModal">DEMO01</a> <!--DEMO01--> <div id="animatedModal"> <!--THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID class="close-animatedModal" --> <div class="close-animatedModal"> CLOSE MODAL </div> <div class="modal-content"> <!--Your modal content goes here--> </div> </div> </body>
STEP3: 嵌入jQuery庫和插件JS,注意必須在你的HTML內容底部。
<body> <!--你的HTML內容--> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="yourPath/animatedModal.min.js"></script>
</body>
STEP4: 初始化
<script> $("#demo01").animatedModal(); </script>
提示:下載的DMEO頁面如果看不到效果,請檢查的你瀏覽器,還有就是jQuery庫的嵌入地址加上http: