国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > JS > 正文

基礎(chǔ)的prototype.js常用函數(shù)及其用法

2024-09-06 12:43:01
字體:
供稿:網(wǎng)友
prototype.js 常用函數(shù) : 
 Element.toggle 
   交替隱藏或顯示 
  Element.toggle(''div1'',''div2'') 
 Element.hide 
   隱藏 
  Element.hide(''div1'',''div2'') 
 Element.show 
 顯示 
  Element.show(''div1'',''div2'') 
 Element.remove 
   刪除 
  Element.remove(''div1'',''div2'') 
 Element.getHeight 
   取得高度 
  Element.getHeight(''div1'') 
 Toggle.display 
   和 Element.toggle 相同 
  Toggle.display(''div1'',''div2'') 
 Insertion.Before 
   在 DIV 前插入文字 
  Insertion.Before(''div1'',''my content'') 
 Insertion.After 
   在 DIV 后插入文字 
  Insertion.After(''div1'',''my content'') 
 Insertion.Top 
   在 DIV 里最前插入文字 
  Insertion.Top(''div1'',''this is a text'') 
 Insertion.Bottom 
   在 DIV 里最后插入文字 
  Insertion.Bottom(''div1'',''this is a text'') 
 PeriodicalExecuter 
   以給定頻率調(diào)用一段 JavaScript 
  PeridicalExecutor(test, 1)" 這里 test 是 Javascript 的函數(shù) ,1 是頻率 (1 秒 ). 
 $ 
   取得一個 DIV, 相當(dāng)于 getElementById() 
  $(''div1'') 
 Field.clear 
   清空一個輸入框 
  Field.clear(''textfield1'') 
 Field.focus 
 把   焦點(diǎn)集中在輸入框上 
  Field.focus(''select1'') 
 Field.present 
   判斷內(nèi)容是否為空 
  alert(Field.present(''textfield1''))" 
 Field.select 
   選擇輸入框的內(nèi)容 
  Field.select(''textfield1'')" 
 Field.activate 
   把   焦點(diǎn)集中在輸入框上并選擇輸入框的內(nèi)容 
  Field.activate(''textfield1'')" 
 Form.serialize 
   把表格內(nèi)容轉(zhuǎn)化成 string 
 Form.getElements 
   取得表格內(nèi)容為數(shù)組形式 
 Form.disable 
  disable 表格所有內(nèi)容 
  Form.disable(''form1'') ( 這個好象不 work) 
 Form.focusFirstElement 
   把焦點(diǎn)集中在表格第一個元素上 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 万载县| 襄汾县| 肇东市| 涿鹿县| 垦利县| 江山市| 洛阳市| 慈利县| 吉木乃县| 英德市| 靖宇县| 谷城县| 丹江口市| 达尔| 凯里市| 富源县| 江北区| 娱乐| 临泉县| 进贤县| 育儿| 桂东县| 金沙县| 资兴市| 禄丰县| 彭水| 襄垣县| 巢湖市| 沛县| 右玉县| 松江区| 尚志市| 泸溪县| 商河县| 元氏县| 万盛区| 自贡市| 乌鲁木齐县| 稷山县| 溧水县| 军事|