JavaScript特效執行個體003-通過按鈕建立視窗

來源:互聯網
上載者:User

標籤:javascript

執行個體003                     通過按鈕建立視窗
執行個體說明

點擊按鈕建立視窗

技術要點主要是使用window是對象的open()方法來建立和調用其他視窗。實現過程1.製作用於點擊按鈕開啟的視窗廣告頁面
<pre name="code" class="html"><html>  <head>  <title>開啟新視窗顯示廣告資訊</title>  <style type="text/css">  body{      background-image:url(new.jpg);      background-repeat:no-repeat;      }  </style>  </head>  <body></body>  </html>
2實現建立視窗功能的index.html
<html>    <head>    <title>定時開啟視窗顯示廣告資訊</title>    <script type="text/jscript" language="javascript">        function pp()      {              window.open("new.html","new","height=280,width=800,top=10,left=20,resizable=no, location=no",false);        }        </script>    </head>    <body><form name = "from1" method = "post" action=""><input type = "button" name = "Button" value= "建立新視窗" onClick = "pp()"/></form></body>    </html> 
註:style標籤的內容為css的知識,我們關注的是script標籤內的內容。這樣我們的這個執行個體就做好了。

JavaScript特效執行個體003-通過按鈕建立視窗

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.