Jquery彈窗

來源:互聯網
上載者:User

標籤:title   click   hidden   jquery   遮罩   ext   script   htm   top   

<title>彈窗</title>    <script src="JS/jquery-1.7.2.js"></script>    <style type="text/css">        #tanchuang {        position:fixed;/*固定住視窗*/        top:100px;        width:30%;        height:300px;       top:-1000px;        left:35%;        overflow:hidden;        z-index:100001;/*彈窗比遮罩要高*/        }        #tc_top {        position:relative;        width:100%;        height:40px;        background-color:#0026ff;        color:white;        text-align:center;        line-height:40px;        }        #tc_main {        position:relative;        width:100%;        height:220px;        background-color:#0ff;                }        #tc_maintext {        position:relative;        width:70%;        height:80%;        left:15%;        top:10%;   background-color:orange;  text-align:center;        }        #tc_bottom {         position:relative;        width:100%;        height:40px;        background-color:#0026ff;        }        #tc_btnok {        position:relative;        width:30%;        height:30px;        background-color:#808080;        left:35%;        top:5px;        text-align:center;        color:white;        line-height:30px;        cursor:pointer;        }        #zhezhao {        position:fixed;        width:100%;        height:100%;        background-color:black;        z-index:100000;        opacity:0.4;        display:none;        }    </style>

  

<input  type="text" id="biaoti"/><br />        <input  type="text" id="neirong"/>        <!--彈窗開始-->        <div id="zhezhao"></div>   <div id="tanchuang">       <div id="tc_top"></div>       <div id="tc_main">           <div id="tc_maintext"></div>       </div>       <div id="tc_bottom">           <div id="tc_btnok">確定</div>       </div>   </div>        <input type="button" value="彈窗"id="tc" />         <!--彈窗結束-->    </form></body></html><script src="JS/tanchuang.js"></script><script type="text/javascript">    $("#tc").click(function () {        tc("標題","內容");    });    </script>

  

function tc(a, b) {//做成方法,可調用    $("#zhezhao").show();    $("#tanchuang").animate({ top: "100" }, 500).animate({ top: "90" }, 200).animate({ top: "100" }, 200);    $("#tc_top").text(a);    $("#tc_maintext").text(b);};$("#tc_btnok").click(function () {    $("#tanchuang").animate({ top: "-2000" }, 500, function () {        $("#zhezhao").hide();    });//點擊確定彈走});

  

Jquery彈窗

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.