11.2
阿新 • • 發佈:2017-11-02
es2017 rri mat 獨立 www. nav har ima 技術
- 夜間模式的開啟與關閉
- 放置點擊的按鈕或圖片。
- 定義開關切換函數。
- onclick函數調用。
- 父模板的制作
- 制作網站網頁共有元素的父模板html,包括頂部導航,中間區塊劃分,底部導航,底部說明等。
- 匯總相關的樣式形成獨立的css文件。
- 匯總相關的js代碼形成獨立的js文件。
- 形成完整的base.html+css+js
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登錄</title> <link rel
box{ width: 300px; } div.box { border: 1px solid #000000; height: 290px; width: 300px; float: left; margin: 50px; background: antiquewhite; } div.input_box{ text-align: center; height: 50px; width: auto; padding: 5px } div.input_box button{ border: aqua; font-size: 20px; width: 100px; height: 30px; background: coral; }
function mySwitch() { var oBady=document.getElementById("myBody"); var oOnoff=document.getElementById("myOnOff"); if(oOnoff.src.match("on")){ oOnoff.src="../static/image/off.png"; oBady.style.background="gray"; oBady.style.color="white"; }else { oOnoff.src = "../static/image/on.png"; oBady.style.background = "white"; oBady.style.color = "black" ; } }
11.2