html新知
文章目錄[x] 開門大吉 輪播樣式 賬戶密碼獲取 回車發(fā)送命令(按鍵) 計時器 通過按鈕實現(xiàn)清屏 選項卡(輪播圖原型) 階乘 密碼一致登錄
導(dǎo)航欄(新學(xué)的,,,,,其實就是簡單的href)
css
開門大吉
輪播樣式
js
css
js1
js1
js1
js1
js1
js7
首先是css
開門大吉
改只需其中的gif
<html><head><style>section{width: 361px;height: 247px;border: red 1px solid;margin: 100px auto;background:url(erha.gif);position: relative;}.l,.r{position: absolute;top:0;width:50%;height:100%;background-color: red;transition:all 1s;}.l{left:0;border:1px solid #000;transform-origin: left;}.r{right:0;border:1px solid #000;transform-origin: right;}section:hover .l{transform: rotateY(-130deg);}section:hover .r{transform: rotateY(-130deg);}</style></head><body><section><div class="l"></div><div class="r"></div></section></body> </html>輪播樣式
<html><style>ul{list-style:none;}div{width: 318px;height: 500px;border: 1px solid #ccc;margin: 50px auto;padding: 5px auto;position: relative;}.l{position:absolute;top: %50;margin-top: -250px;left:0;}.r{position:absolute;top: %50;margin-top: -250px;right:0;}.circle{width:65px;height: 13px;background-color:;position:absolute;margin-top: -14px;left: 50%;margin-left: -55px;}.circle li{width:9px;height: 9px;background-color: #B7B7B7;float: right;margin: 2px;border-radius: 50%;background: rgba(0,0,0,0.5);}.circle .current{background-color: #f40;}</style> <body><div><img src="2.jpg" height="500" ><img src="left.png" width="40" height="40" class="l" ><img src="right.png" width="30" height="40" class="r"><ul class="circle"><li class="current"></li><li></li><li></li><li></li><li></li><ul></div> </body> </html>隨便找的圖
js
賬戶密碼獲取
<html><title>show</title> <body><form method="get" action="xxx.php"><input type="txt" name="username" value=""><input type="password" name="word" value=""><input type="submit" name="sub" ></form> </body> </html>xxx.php
<?phpecho '<pre>';var_dump($_REQUEST);回車發(fā)送命令(按鍵)
<html> <head> <meta charset="utf8"> <style> #count{width:200px;height:100px;border:black solid 1px; } </style> <link rel="stylesheet" href="css/bootstrap.css"> <script src="js/jquery-3.4.1.js"></script> <script src="js/bootstrap.js"></script> </head><body> <div> <input type="button" id="btn" value="點我"> <input type="text" id="txt" value=""></div> <div id="count"></div><script>document.onkeydown = function(e){if(e.keyCode==13){count.innerHTML = txt.value;}}btn.onclick = function(){count.innerHTML = txt.value;}</script> </body></html>計時器
<html> <head> <meta charset="utf8"> <style> #count{width:200px;height:100px;border:black solid 1px; } </style> <link rel="stylesheet" href="css/bootstrap.css"> </head><body> <div> <input type="button" id="btn" value="點我"> </div> <div id="count"><span><span> </div><script>var a=document.getElementById('btn');var b=document.getElementById('count');var timer =null;var count=0;b.innerHTML=count;timer = function tip(){count++;b.innerHTML=count;}a.onclick=function(){setInterval(timer,1000);}</script> </body><script src="js/jquery-3.4.1.js"></script> <script src="js/bootstrap.js"></script> </html>通過按鈕實現(xiàn)清屏
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script> window.onload=function(){ document.getElementById("btn").onclick=function(){displayDate()};function displayDate(){ txt.value="我喜歡你"; } }</script> </head> <body> <input id="txt" value=""> <button id="btn">清屏</button></body> </html>選項卡(輪播圖原型)
<html> <head> <meta charset="utf8"> <style> #div1 div{ width:200px; height:200px; border:black solid 2px; display: none; }#div1 .active{ background:red; } </style> <link rel="stylesheet" href="css/bootstrap.css"> </head><body> <div id="div1"><input id="btn1" class="active" type="button" value="農(nóng)藥資訊"><input id="btn2" type="button" value="前方消息"><input id="btn3" type="button" value="最新報道"><input id="btn4" type="button" value="聊天"><div style="display:block;">21123</div><div >321231</div><div >231321</div><div>54654321</div></div ><script>var oDiv=document.getElementById("div1");var aBtn=div1.getElementsByTagName("input");var aDiv=div1.getElementsByTagName("div");for(var i=0;i<aBtn.length;i++){ aBtn[i].index=i;aBtn[i].onclick=function(){ for(var i=0;i<aBtn.length;i++){aBtn[i].className="none";aDiv[i].style.display="none";}this.className="active";aDiv[this.index].style.display='block';}}</script> </body><script src="js/jquery-3.4.1.js"></script> <script src="js/bootstrap.js"></script></body> </html>階乘
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script> //點擊btn觸發(fā)函數(shù)事件 window.onload=function() { document.getElementById("btn").onclick=function(){add() } };//定義一個階乘的函數(shù) function add() {var i,j=1;for(i=1;i<=txt.value;i++){j=j*i;}txt1.value=j; }</script> </head> <body> <input id="txt" value=""> <button id="btn">的階乘是</button> <input id="txt1" value=""></body> </html>密碼一致登錄
<html><body><input type="password" id="password" name="password" value="登 錄"/> 加個按鈕 <input name="a" type="submit" value="登 錄" onclick="checkpassword();"/></body> <script>function checkpassword(){var pwd="1234567";//你和朋友約定的密碼,寫死的var inpwd=document.getElementById("password").value;//獲取輸入的代碼if(pwd == inpwd){ //判斷一下是否一樣window.location.href="img1.html";} } alert(inpwd); </script></html>Top
總結(jié)
- 上一篇: Web托管服务器性能测试-如何真正做到这
- 下一篇: 编程开发的电脑配置?