夢想飛翔

          自強(qiáng)不息
          posts - 111, comments - 30, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          javascript事件查詢綜合

          Posted on 2007-08-10 15:38 love1563 閱讀(254) 評論(0)  編輯  收藏 所屬分類: JSP/Servlets/JSF

          click() 對象 .click() 使對象被點(diǎn)擊。
          closed 對象 .closed 對象窗口是否已關(guān)閉 true/false
          clearTimeout( 對象 ) 清除已設(shè)置的 setTimeout 對象
          clearInterval( 對象 ) 清除已設(shè)置的 setInterval 對象
          confirm(" 提示信息 ") 彈出確認(rèn)框,確定返回 true 取消返回 false
          cursor: 樣式 更改鼠標(biāo)樣式 hand crosshair text wait help default auto e/s/w/n-resize

          event.clientX 返回最后一次點(diǎn)擊鼠標(biāo) X 坐標(biāo)值;
          event.clientY 返回最后一次點(diǎn)擊鼠標(biāo) Y 坐標(biāo)值;
          event.offsetX 返回當(dāng)前鼠標(biāo)懸停 X 坐標(biāo)值
          event.offsetY 返回當(dāng)前鼠標(biāo)懸停 Y 坐標(biāo)值

          document.write(document.lastModified)
          網(wǎng)頁最后一次更新時間
          document.ondblclick=x 當(dāng)雙擊鼠標(biāo)產(chǎn)生事件
          document.onmousedown=x 單擊鼠標(biāo)鍵產(chǎn)生事件

          document.body.scrollTop; 返回和設(shè)置當(dāng)前豎向滾動條的坐標(biāo)值,須與函數(shù)配合 ,
          document.body.scrollLeft; 返回和設(shè)置當(dāng)前橫向滾動務(wù)的坐標(biāo)值,須與函數(shù)配合,
          document.title document.title="message"; 當(dāng)前窗口的標(biāo)題欄文字
          document.bgcolor document.bgcolor=" 顏色值 "; 改變窗口背景顏色
          document.Fgcolor document.Fgcolor=" 顏色值 "; 改變正文顏色
          document.linkcolor document.linkcolor=" 顏色值 "; 改變超聯(lián)接顏色
          document.alinkcolor document.alinkcolor=" 顏色值 "; 改變正點(diǎn)擊聯(lián)接的顏色
          document.VlinkColor document.VlinkColor=" 顏色值 "; 改變已訪問聯(lián)接的顏色
          document.forms.length 返回當(dāng)前頁 form 表單數(shù)
          document.anchors.length 返回當(dāng)前頁錨的數(shù)量
          document.links.length 返回當(dāng)前頁聯(lián)接的數(shù)量
          document.onmousedown=x 單擊鼠標(biāo)觸發(fā)事件
          document.ondblclick=x 雙擊鼠標(biāo)觸發(fā)事件
          defaultStatus window.status=defaultStatus; 將狀態(tài)欄設(shè)置默認(rèn)顯示

          function function xx(){...} 定義函數(shù)
          isNumeric 判斷是否是數(shù)字
          innerHTML xx= 對象 .innerHTML 輸入某對象標(biāo)簽中的 html 源代碼
          innerText divid.innerText=xx 將以 div 定位以 id 命名的對象值設(shè)為 XX

          location.reload(); 使本頁刷新, target 可等于一個刷新的網(wǎng)頁

          Math.random() 隨機(jī)涵數(shù) , 只能是 0 1 之間的數(shù) , 如果要得到其它數(shù) , 可以為 *10, 再取整
          Math.floor(number) 將對象 number 轉(zhuǎn)為整數(shù),舍取所有小數(shù)
          Math.min(1,2) 返回 1,2 哪個小
          Math.max(1,2) 返回 1,2 哪個大

          navigator.appName 返回當(dāng)前瀏覽器名稱
          navigator.appVersion 返回當(dāng)前瀏覽器版本號
          navigator.appCodeName 返回當(dāng)前瀏覽器代碼名字
          navigator.userAgent 返回當(dāng)前瀏覽器用戶代標(biāo)志

          onsubmit onsubmit="return(xx())" 使用函數(shù)返回值
          opener opener.document. 對象 控制原打開窗體對象

          prompt xx=window.prompt(" 提示信息 "," 預(yù)定值 "); 輸入語句
          parent parent. 框架名 . 對象 控制框架頁面

          return return false 返回值
          random 隨機(jī)參數(shù)( 0 1 之間)
          reset() form.reset(); 使 form 表單內(nèi)的數(shù)據(jù)重置

          split("") string.split("") string 對象字符以逗號隔開
          submit() form 對象 .submit() 使 form 對象提交數(shù)據(jù)

          String 對象的 charAt(x) 對象 反回指定對象的第多少位的字母
          lastIndexOf("string") 從右到左詢找指定字符,沒有返回 -1
          indexOf("string") 從左到右詢找指定字符,沒有返回 -1
          LowerCase() 將對象全部轉(zhuǎn)為小寫
          UpperCase() 將對象全部轉(zhuǎn)為大寫
          substring(0,5) string.substring(x,x) 返回對象中從 0 5 的字符
          setTimeout("function",time) 設(shè)置一個超時對象
          setInterval("function",time) 設(shè)置一個超時對象

          toLocaleString() x.toLocaleString() x 時間對象中獲取時間,以字符串型式存在
          typeof(
          變量名 ) 檢查變量的類型,值有: String,Boolean,Object,Function,Underfined

          window.event.button==1/2/3 鼠標(biāo)鍵左鍵等于 1 右鍵等于 2 兩個鍵一起按為 3
          window.screen.availWidth 返回當(dāng)前屏幕寬度 ( 空白空間 )
          window.screen.availHeight 返回當(dāng)前屏幕高度 ( 空白空間 )
          window.screen.width 返回當(dāng)前屏幕寬度 ( 分辨率值 )
          window.screen.height 返回當(dāng)前屏幕高度 ( 分辨率值 )
          window.document.body.offsetHeight; 返回當(dāng)前網(wǎng)頁高度
          window.document.body.offsetWidth; 返回當(dāng)前網(wǎng)頁寬度
          window.resizeTo(0,0) 將窗口設(shè)置寬高
          window.moveTo(0,0) 將窗口移到某位置
          window.focus() 使當(dāng)前窗口獲得焦點(diǎn)
          window.scroll(x,y) 窗口滾動條坐標(biāo), y 控制上下移動,須與函數(shù)配合
          window.open() window.open(" 地址 "," 名稱 "," 屬性 ")
          屬性 :toolbar( 工具欄 ),location( 地址欄 ),directions,status( 狀態(tài)欄 ),
          menubar(
          菜單欄 ),scrollbar( 滾動條 ),resizable( 改變大小 ), width( ),height( ),fullscreen( ),scrollbars( 全屏?xí)r無滾動條無參 數(shù) ,channelmode( 寬屏 ),left( 打開窗口 x 坐標(biāo) ),top( 打開窗口 y 坐標(biāo) )
          window.location = 'view-source:' + window.location.href 應(yīng)用事件查看網(wǎng)頁源代碼 ;


          a=new Date(); // 創(chuàng)建 a 為一個新的時期對象
          y=a.getYear(); //y 的值為從對象 a 中獲取年份值 兩位數(shù)年份
          y1=a.getFullYear(); // 獲取全年份數(shù) 四位數(shù)年份
          m=a.getMonth(); // 獲取月份值
          d=a.getDate(); // 獲取日期值
          d1=a.getDay(); // 獲取當(dāng)前星期值
          h=a.getHours(); // 獲取當(dāng)前小時數(shù)
          m1=a.getMinutes(); // 獲取當(dāng)前分鐘數(shù)
          s=a.getSeconds(); // 獲取當(dāng)前秒鐘數(shù)


          對象 .style.fontSize=" 文字大小 ";
          單位: mm/cm/in 英寸 /pc /pt 點(diǎn) /px 象素 /em 文字高
          1in=1.25cm
          1pc=12pt
          1pt=1.2px(800*600
          分辯率下 )

          文本字體屬性:
          fontSize
          大小
          family
          字體
          color
          顏色
          fontStyle
          風(fēng)格,取值為 normal 一般 ,italic 斜體 ,oblique 斜體且加粗
          fontWeight
          加粗 , 取值為 100 900 不等 ,900 最粗 ,light,normal,bold
          letterSpacing
          間距 , 更改文字間距離 , 取值為 ,1pt,10px,1cm
          textDecoration:
          文字修飾 ; 取值 ,none 不修飾 ,underline 下劃線 ,overline 上劃線
          background:
          文字背景顏色 ,
          backgroundImage:
          背景圖片 , 取值為圖片的插入路徑


          點(diǎn)擊網(wǎng)頁正文函數(shù)調(diào)用觸發(fā)器:

          1.onClick
          當(dāng)對象被點(diǎn)擊
          2.onLoad
          當(dāng)網(wǎng)頁打開 , 只能書寫在 body
          3.onUnload
          當(dāng)網(wǎng)頁關(guān)閉或離開時 , 只能書寫在 body
          4.onmouseover
          當(dāng)鼠標(biāo)懸于其上時
          5.onmouseout
          當(dāng)鼠標(biāo)離開對象時
          6.onmouseup
          當(dāng)鼠標(biāo)松開
          7.onmousedown
          當(dāng)鼠標(biāo)按下鍵
          8.onFocus
          當(dāng)對象獲取焦點(diǎn)時
          9.onSelect
          當(dāng)對象的文本被選中時
          10.onChange
          當(dāng)對象的內(nèi)容被改變
          11.onBlur
          當(dāng)對象失去焦點(diǎn)
          onsubmit=return(ss())
          表單調(diào)用時返回的值

          直線 border-bottom:1x solid black
          虛線 border-bottom:1x dotted black
          點(diǎn)劃線 border-bottom:2x dashed black
          雙線 border-bottom:5x double black
          槽狀 border-bottom:1x groove black
          脊?fàn)?/span> border-bottom:1x ridge black


          1.
          邊緣高光 glow(color= 顏色 ,strength= 亮光大小 )<br>
          2.
          水平翻轉(zhuǎn) fliph() 使對象水平翻轉(zhuǎn) 180 <br>
          3.
          垂直翻轉(zhuǎn) flipv() 使對象垂直翻轉(zhuǎn) 180 <br>
          4.
          對象模糊 blur(add=true/false direction= 方向 strength= 強(qiáng)度 )
          add
          指定是否按印象畫派進(jìn)行模糊 direction 模糊方向 strength 模糊強(qiáng)度
          5.
          對象透明 alpha(opaction=0-100,finishopacity=0-100,style=0/1/2/3)
          opaction
          對象整體不透明值 finishopacity 當(dāng)對象利用了漸透明時該項(xiàng)指定結(jié)束透明位置的不透明值 style 指定透明方式 0 為整體透明, 1 為線型透明, 2 為圓型透明, 3 為矩形透明
          6.
          去除顏色 chroma(color= 顏色值 ) 使對象中顏色與指定顏色相同區(qū)域透明
          7.
          建立陰影 dropshadow(color= 陰影顏色 ,offx= 水平向左偏離像素 ,offy= 水平向下偏離像素 )
          8.
          去色 gray() 使對象呈灰度顯示
          9.
          負(fù)片效果 invert() 使對象呈底片效果
          10.
          高光 light() 使對象呈黑色顯示
          11.
          遮蓋 mask(color= 顏色 ) 使整個對象以指定顏色進(jìn)行蒙板一次

          opacity
          表透明度水平 .0~100,0 表全透明 ,100 表完全不透明
          finishopacity
          表想要設(shè)置的漸變透明效果 .0~100.
          style
          表透明區(qū)的形狀 .0 表統(tǒng)一形狀 .1 表線形 .2 表放射形 .3 表長方形 .
          startx.starty
          表漸變透明效果的開始時 X Y 坐標(biāo) .
          finishx,finishy
          漸變透明效果結(jié)束時 x,y 的坐標(biāo) .
          add
          有來確定是否在模糊效果中使有原有目標(biāo) . 值為 0,1.0 " ",1 " ".
          direction
          設(shè)置模糊的方向 .0 度表垂直向上 ,45 度為一個單位 . 默認(rèn)值是向左 270 .left,right,down,up.
          strength
          只能用整數(shù)來確定 . 代表有多少個像素的寬度將受到模糊影響 . 默認(rèn)是 5 .
          color
          要透明的顏色 .
          offx,offy
          分別是 x,y 方向陰影的偏移量 .
          positive
          指投影方式 .0 表透明像素生成陰影 .1 表只給出不透明像素生成陰影 ..

          AddAmbient:
          加入包圍的光源 .
          AddCone:
          加入錐形光源 .
          AddPoint
          加入點(diǎn)光源
          Changcolor:
          改變光的顏色.
          Changstrength:
          改變光源的強(qiáng)度.
          Clear:
          清除所有的光源.
          MoveLight:
          移動光源.

          freq
          是波紋的頻率,在指定在對象上一區(qū)需要產(chǎn)生多少個完事的波紋.
          lightstrength
          可對于波紋增強(qiáng)光影的效果.顯著 0~100 正整數(shù),正弦波開始位置是 0~360 度. 0 表從 0 度開始, 25 表從 90 度開始.
          strength
          表振幅大小.


          hand style="cursor:hand"
          crosshair style="cursor:crosshair"
          text style="cursor:text"
          wait style="cursor:wait"
          default style="cursor:default"
          help style="cursor:help"
          e-resize style="cursor:e-resize"
          ne-resize style="cursor:ne-resize"
          n-resize style="cursor:n-resize"
          nw-resize style="cursor:nw-resize"
          w-resize style="cursor:w-resize"
          s-resize style="cursor:s-resize"
          sw-resize style="cursor:sw-resize "
          se-resize style="cursor:se-resize"
          auto style="cursor:auto"

          主站蜘蛛池模板: 梅河口市| 澜沧| 杭州市| 德阳市| 化州市| 峨边| 古浪县| 铅山县| 聂拉木县| 乳山市| 沙河市| 五大连池市| 余江县| 改则县| 清水县| 深州市| 文成县| 光山县| 济阳县| 东乡县| 鄱阳县| 安徽省| 宿松县| 司法| 英吉沙县| 竹山县| 福建省| 高陵县| 河南省| 苏尼特右旗| 丰宁| 三原县| 开原市| 咸阳市| 徐汇区| 凤凰县| 盐池县| 吉木萨尔县| 锡林浩特市| 红河县| 革吉县|