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

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;
}
主站蜘蛛池模板: 错那县| 察隅县| 无棣县| 晋州市| 青川县| 都江堰市| 玉环县| 巨鹿县| 准格尔旗| 湟源县| 全南县| 长顺县| 邓州市| 石城县| 高雄市| 白朗县| 疏附县| 保康县| 澎湖县| 依安县| 桐梓县| 乾安县| 祁门县| 新龙县| 枣强县| 无锡市| 十堰市| 潼南县| 温泉县| 鹿泉市| 彭水| 墨江| 华亭县| 中宁县| 昭通市| 弥勒县| 石嘴山市| 隆德县| 新宁县| 桃江县| 滨海县|