官术网_书友最值得收藏!

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">
&times;
</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;
}
主站蜘蛛池模板: 邓州市| 顺昌县| 彭水| 新干县| 吕梁市| 赤水市| 泌阳县| 永昌县| 阜城县| 鹰潭市| 尼勒克县| 铜陵市| 丰城市| 龙泉市| 独山县| 叶城县| 临漳县| 铜陵市| 台州市| 松江区| 晋江市| 永春县| 卓资县| 宣武区| 长海县| 馆陶县| 河西区| 大关县| 贡觉县| 丰顺县| 江都市| 绍兴县| 湟源县| 惠水县| 大冶市| 额敏县| 保靖县| 汤原县| 临潭县| 炉霍县| 怀宁县|