夢想飛翔

          自強不息
          posts - 111, comments - 30, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          javascript事件查詢綜合

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

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

          event.clientX 返回最后一次點擊鼠標 X 坐標值;
          event.clientY 返回最后一次點擊鼠標 Y 坐標值;
          event.offsetX 返回當前鼠標懸停 X 坐標值
          event.offsetY 返回當前鼠標懸停 Y 坐標值

          document.write(document.lastModified)
          網頁最后一次更新時間
          document.ondblclick=x 當雙擊鼠標產生事件
          document.onmousedown=x 單擊鼠標鍵產生事件

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

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

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

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

          navigator.appName 返回當前瀏覽器名稱
          navigator.appVersion 返回當前瀏覽器版本號
          navigator.appCodeName 返回當前瀏覽器代碼名字
          navigator.userAgent 返回當前瀏覽器用戶代標志

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

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

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

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

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

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

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


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


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

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


          點擊網頁正文函數調用觸發器:

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

          直線 border-bottom:1x solid black
          虛線 border-bottom:1x dotted black
          點劃線 border-bottom:2x dashed black
          雙線 border-bottom:5x double black
          槽狀 border-bottom:1x groove black
          脊狀 border-bottom:1x ridge black


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

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

          AddAmbient:
          加入包圍的光源 .
          AddCone:
          加入錐形光源 .
          AddPoint
          加入點光源
          Changcolor:
          改變光的顏色.
          Changstrength:
          改變光源的強度.
          Clear:
          清除所有的光源.
          MoveLight:
          移動光源.

          freq
          是波紋的頻率,在指定在對象上一區需要產生多少個完事的波紋.
          lightstrength
          可對于波紋增強光影的效果.顯著 0~100 正整數,正弦波開始位置是 0~360 度. 0 表從 0 度開始, 25 表從 90 度開始.
          strength
          表振幅大?。?/span>


          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"

          主站蜘蛛池模板: 永登县| 陇西县| 封开县| 城市| 巴青县| 静海县| 安吉县| 大渡口区| 隆子县| 凭祥市| 蒙阴县| 乐东| 克什克腾旗| 湖州市| 台南市| 禄劝| 汉川市| 建湖县| 文水县| 新营市| 仁寿县| 桃园县| 漳州市| 辽阳县| 开封县| 新源县| 剑阁县| 贵德县| 太仓市| 襄城县| 普定县| 合阳县| 赞皇县| 铁力市| 莒南县| 宿松县| 垦利县| 于都县| 孝昌县| 岳西县| 牙克石市|