javascript事件查詢綜合

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表振幅大小.

 


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"

 

 

<OBJECT id=WebBrowser height=0 width=0
classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></OBJECT>
<INPUT onclick=document.all.WebBrowser.ExecWB(1,1) type=button value=打開 name=Button1>
<INPUT onclick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存爲 name=Button2>
<INPUT onclick=document.all.WebBrowser.ExecWB(10,1) type=button value=屬性 name=Button3>
<INPUT onclick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印 name=Button>
<INPUT onclick=document.all.WebBrowser.ExecWB(8,1) type=button value=頁面設置 name=Button4>
<INPUT onclick=window.location.reload() type=button value=刷新 name=refresh>
<INPUT onclick="window.external.ImportExportFavorites(true,'');" type=button value=導入收藏夾 name=Button5>
<INPUT onclick="window.external.ImportExportFavorites(false,'');" type=button value=導出收藏夾 name=Button32>
<INPUT onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夾 name=Button22>
<INPUT onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" type=button value=整理收藏夾 name=Submit2>
<INPUT onclick='window.location="view-source:" + window.location.href' type=button value=查看源文件 name=Button7>
<INPUT onclick="window.external.ShowBrowserUI('LanguageDialog', null)" type=button value=語言設置 name=Button6>
<INPUT onclick="document.execCommand('Cut')" type=button value=剪切>
<INPUT onclick="document.execCommand('Copy')" type=button value=拷貝>
<INPUT onclick="document.execCommand('Paste')" type=button value=粘貼>
<INPUT onclick="document.execCommand('Undo')" type=button value=撤消>
<INPUT onclick="document.execCommand('Delete')" type=button value=刪除>
<INPUT onclick="document.execCommand('Bold')" type=button value=黑體>
<INPUT onclick="document.execCommand('Italic')" type=button value=斜體>
<INPUT onclick="document.execCommand('Underline')" type=button value=下劃線>
<INPUT onclick="document.execCommand('stop')" type=button value=停止>
<INPUT onclick="document.execCommand('SaveAs')" type=button value=保存>
<INPUT onclick="document.execCommand('Saveas',false,'c:\\test.htm')" type=button value=另存爲>
<INPUT onclick="document.execCommand('FontName',false,fn)" type=button value=字體>
<INPUT onclick="document.execCommand('FontSize',false,fs)" type=button value=字體大小>
<INPUT onclick="document.execCommand('refresh',false,0)" type=button value=刷新>
<INPUT onclick=window.location.reload() type=button value=刷新>
<INPUT onclick=history.go(1) type=button value=前進>
<INPUT onclick=history.go(-1) type=button value=後退>
<INPUT onclick=history.forward() type=button value=前進>
<INPUT onclick=history.back() type=button value=後退>
<INPUT onclick='window.external.ImportExportFavorites(true,"http://localhost");' type=button value=導入收藏夾>
<INPUT onclick='window.external.ImportExportFavorites(false,"http://localhost");' type=button value=導出收藏夾>
<INPUT onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" type=button value=整理收藏夾>
<INPUT onclick="window.location = 'view-source:'+ window.location.href" type=button value=查看源文件>
<INPUT onclick="window.external.ShowBrowserUI('LanguageDialog', null)" type=button value=語言設置>
<INPUT onclick="window.external.AddFavorite('http://www.cnblogs.com/hbzxf/', 阿好空間)" type=button value=加入收藏夾>
<INPUT onclick="window.external.addChannel('http://www.cnblogs.com/hbzxf/')" type=button value=加入到頻道>
<INPUT onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.cnblogs.com/hbzxf/')" type=button value=設成主頁>

窗口打開自動最大化代碼
<!-- 窗口打開後最大化 -->
<OBJECT id="max" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><PARAM name="Command" value="Maximize"></OBJECT>
<script>
if(window.screenLeft!=0)
max.Click();
</script>
<!-- 窗口打開後最大化結束 -->

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章