欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

javascript+html5+css3如何實現(xiàn)自定義彈出窗口效果

這篇文章主要介紹javascript+html5+css3如何實現(xiàn)自定義彈出窗口效果,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

成都創(chuàng)新互聯(lián)是專業(yè)的高唐網(wǎng)站建設(shè)公司,高唐接單;提供成都網(wǎng)站建設(shè)、網(wǎng)站制作,網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進行高唐網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!

效果圖:

javascript+html5+css3如何實現(xiàn)自定義彈出窗口效果

源碼:

1.demo.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>自定義彈出窗口</title>
  <script type="text/javascript" src="js/myLayer.js"></script>
  <style type="text/css">
    button{
      width: 50px;
      height: 50px;
      border: 1px solid blue;
      background-color: blue;
      color: red;
      border-radius: 5px;
      -webkit-box-shadow: 2px 2px 2px gray;
      -moz-box-shadow: 2px 2px 2px gray ;
      box-shadow: 2px 2px 2px gray ;
    }
    button:hover{
      background-color: green;
      cursor: pointer;
    }
  </style>
  <script type="text/javascript">
    function openWindow() {
      new MyLayer({
        top:"10%",
        left:"10%",
        width:"80%",
        height:"80%",
        title:"我的標(biāo)題",
        content:"操作成功"
      }).openLayer();
    }
  </script>
</head>
<body>
  <button type="button" onclick="openWindow()">打開彈窗</button>
</body>
</html> 

2.myLayer.js

/**
 * Created by zhuwenqi on 2017/6/16.
 */
/**
 * @param options 彈窗基本配置信息
 * @constructor 構(gòu)造方法
 */
function MyLayer(options) {
  this.options = options ;
}
/**
 * 打開彈窗
 */
MyLayer.prototype.openLayer = function () {
  var background_layer = document.createElement("div");
  background_layer.style.display = "none";
  background_layer.style.position = "absolute";
  background_layer.style.top = "0px";
  background_layer.style.left = "0px";
  background_layer.style.width = "100%";
  background_layer.style.height = "100%";
  background_layer.style.backgroundColor = "gray";
  background_layer.style.zIndex = "1001";
  background_layer.style.opacity = "0.8" ;
  var open_layer = document.createElement("div");
  open_layer.style.display = "none";
  open_layer.style.position = "absolute";
  open_layer.style.top = this.options.top === undefined ? "10%" : this.options.top;
  open_layer.style.left = this.options.left === undefined ? "10%" :this.options.left;
  open_layer.style.width = this.options.width === undefined ? "80%" : this.options.width;
  open_layer.style.height = this.options.height === undefined ? "80%" : this.options.height;
  open_layer.style.border = "1px solid lightblue";
  open_layer.style.borderRadius = "15px" ;
  open_layer.style.boxShadow = "4px 4px 10px #171414";
  open_layer.style.backgroundColor = "white";
  open_layer.style.zIndex = "1002";
  open_layer.style.overflow = "auto";
  var div_toolBar = document.createElement("div");
  div_toolBar.style.textAlign = "right";
  div_toolBar.style.paddingTop = "10px" ;
  div_toolBar.style.backgroundColor = "aliceblue";
  div_toolBar.style.height = "40px";
  var span_title = document.createElement("span");
  span_title.style.fontSize = "18px";
  span_title.style.color = "blue" ;
  span_title.style.float = "left";
  span_title.style.marginLeft = "20px";
  var span_title_content = document.createTextNode(this.options.title === undefined ? "" : this.options.title);
  span_title.appendChild(span_title_content);
  div_toolBar.appendChild(span_title);
  var span_close = document.createElement("span");
  span_close.style.fontSize = "16px";
  span_close.style.color = "blue" ;
  span_close.style.cursor = "pointer";
  span_close.style.marginRight = "20px";
  span_close.onclick = function () {
    open_layer.style.display = "none";
    background_layer.style.display = "none";
  };
  var span_close_content = document.createTextNode("關(guān)閉");
  span_close.appendChild(span_close_content);
  div_toolBar.appendChild(span_close);
  open_layer.appendChild(div_toolBar);
  var div_content = document.createElement("div");
  div_content.style.textAlign = "center";
  var content_area = document.createTextNode(this.options.content === undefined ? "" : this.options.content);
  div_content.appendChild(content_area);
  open_layer.appendChild(div_content);
  document.body.appendChild(open_layer);
  document.body.appendChild(background_layer);
  open_layer.style.display = "block" ;
  background_layer.style.display = "block";
};

以上是“javascript+html5+css3如何實現(xiàn)自定義彈出窗口效果”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

本文名稱:javascript+html5+css3如何實現(xiàn)自定義彈出窗口效果
路徑分享:http://aaarwkj.com/article30/pesipo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號、全網(wǎng)營銷推廣、靜態(tài)網(wǎng)站、App開發(fā)、標(biāo)簽優(yōu)化、網(wǎng)頁設(shè)計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)
传媒视频在线观看网站| 欧美在线免费黄片视频| 亚洲中文字幕乱码一二三| 亚洲精品隔壁傲慢人妻| 青青草成人免费在线公开视频| 森泽佳奈在线视频观看| 亚洲午夜经典一区二区日韩| 国产高清亚洲精品视频| 久久久人妻91久久久久| 久久久精品国产亚洲av网黑人| 久久精品91久久久| 亚洲视频在线男人天堂| 国产又粗又爽视频免费| 亚洲一区二区精品偷拍| 综合久久99中文综合久久| 国产av一区二区三区野战| 中文字幕一区二区中文字幕| 国产国语激情对白在线| 人妻一区二区三区中文字幕| 日本岛国免费一区二区| 久久国产精品午夜亚洲欧美| 久久精品少妇人妻视频| 久久中文人妻丝袜不卡| 久草亚洲一区二区三区av| 久久精品国产亚洲av不卡| 久久精品午夜福利一区| 禁止18黄色免费网站| 国产成人自拍视频网站| 国产亚洲av综合人人精品| 四虎海外永久免费地址| 欧美日韩激情在线一区| 岛国av不卡一二三区| 欧美大片黄片在线观看| 色婷婷亚洲综合色一区二区| 99久久精品费精品国产风间由美| 国产91极品尤物白丝美女| 在线成人影院中文字幕| 亚洲国产精品有码专区| 粗暴蹂躏中文一区二区三区| 女同一区二区三区在线| 亚洲人妖视频在线观看|