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

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;
}
主站蜘蛛池模板: 广宗县| 特克斯县| 沈阳市| 邛崃市| 潍坊市| 报价| 华蓥市| 扶余县| 宁河县| 华蓥市| 凌源市| 宜宾县| 台北县| 庆城县| 济阳县| 读书| 钟祥市| 都安| 新昌县| 若尔盖县| 福泉市| 道真| 思南县| 吉木萨尔县| 邻水| 思茅市| 湟源县| 芮城县| 阿鲁科尔沁旗| 郓城县| 蓬安县| 泾川县| 贡山| 通道| 台安县| 耿马| 沙湾县| 清水河县| 徐水县| 泾源县| 绿春县|