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

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;
}
主站蜘蛛池模板: 增城市| 沭阳县| 云和县| 四子王旗| 北流市| 太仆寺旗| 鲁甸县| 灯塔市| 黔江区| 沛县| 宜州市| 巴青县| 安龙县| 澜沧| 惠水县| 吴川市| 绵阳市| 远安县| 长治市| 湛江市| 庆安县| 涿州市| 民乐县| 神农架林区| 湖南省| 盖州市| 城固县| 五河县| 平南县| 泰宁县| 寿光市| 自贡市| 镇安县| 吐鲁番市| 新巴尔虎右旗| 大渡口区| 新源县| 肃北| 榕江县| 安泽县| 大名县|