- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 92字
- 2021-07-02 19:57:23
Closing
Users will need a way to close their modal and return to the main window. We'll overlay a button in the top-right corner that, when clicked, evaluates an expression to setmodalOpentofalse. Theshowclass on our wrapper p will consequentially be removed, which means the display CSS property will return tonone,thus removing the modal from the page.
index.html:
<p id="modal" v-bind:class="{ show : modalOpen }"> <button v-on:click="modalOpen = false" class="modal-close">
×
</button> <p class="modal-content"> <img src="sample/header.jpg"/> </p> </p>
style.css:
.modal-close { position: absolute; right: 0; top: 0; padding: 0px 28px 8px; font-size: 4em; width: auto; height: auto; background: transparent; border: 0; outline: none; color: #ffffff; z-index: 1000; font-weight: 100; line-height: 1; }
推薦閱讀
- Python數據可視化:基于Bokeh的可視化繪圖
- OpenCV實例精解
- 圖解Java數據結構與算法(微課視頻版)
- Java Web基礎與實例教程(第2版·微課版)
- Python程序設計(第3版)
- Web Development with Django Cookbook
- Mastering Articulate Storyline
- OpenNI Cookbook
- Functional Kotlin
- Bootstrap 4:Responsive Web Design
- Android Native Development Kit Cookbook
- C專家編程
- Android應用開發實戰
- Python機器學習與量化投資
- Kotlin進階實戰