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

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;
}
主站蜘蛛池模板: 海原县| 谢通门县| 榕江县| 德昌县| 武定县| 麻城市| 武邑县| 板桥市| 湖南省| 江都市| 永昌县| 杨浦区| 大悟县| 棋牌| 永丰县| 柳州市| 巴楚县| 阳高县| 上虞市| 横峰县| 富宁县| 张家口市| 文成县| 惠安县| 苏尼特右旗| 冷水江市| 镇坪县| 阿克陶县| 乾安县| 阿巴嘎旗| 龙泉市| 岱山县| 沙雅县| 澳门| 东宁县| 茂名市| 广安市| 博野县| 江城| 梁河县| 卫辉市|