html+jquer+css知識積累

1、htmlcss

一、設置下拉框選擇第n個html

var a = document.getElementById("mySelect");jquery

a.options[n].selected = true數組

a.value = "xxx"字體

2、jqueryspa

一、jquery 事件委託   $("ul").on("click","li",function)htm

使用的好處:對象

1)只需對 ul 綁定事件,而無須對其 li 綁定事件,這樣就減小資源的消耗;繼承

2)當 li 是動態加入時,不須要爲新加入的 li 綁定事件。事件

二、checkbox判斷是否選中,須要使用  $("checkbox").is(":checked") 來判斷

三、設置下拉框的選擇項爲第n個

$("#mySelect option:eq(n)").prop("selected","selected");

$("#mySelect").val("xxxx")

3、css

一、overflow-y: auto; 屬性設置當實際高度大於但是高度時出現垂直滾動條;

二、border: 1px solid color;  設置邊框  solid 必定要有啊,否則出不來;

三、word-break: break-all; 強制換行 ,當長度大於設定長度是強制換行;

四、display : inline; 顯示在同一行

五、em 與 px   em 爲指字體高(值並非固定的、會繼承父級元素的字體大小)  px 爲大小單位

4、js

一、數據類型    undefind(undefind)、boolean(true、false、null)、number(整數、浮點數)、object(數組、對象)

二、js 定時任務 setTimeout(function,delayTime)和setInterval(function,delayTime)

setTimeout 只執行一次,  取消方法就是 window.clearTimeout(instance); 其中instance的類型爲setTimeout的;

setInterval 不斷執行,  能夠理解爲無數次 setTimeout   window.clearInterval(instance);其中instance的類型爲 setInterva.

相關文章
相關標籤/搜索