祝大家新年快乐!新年新气象!

javascript事件查询综合

上一篇 / 下一篇  2007-05-07 08:39:21 / 个人分类:js


0NN2S8Q4up,]%P0PHPChina 开源社区门户'\XS ][
click() 对象.click() 使对象被点击。  
+K2`gtCt$^@0closed 对象.closed 对象窗口是否已关闭true/false  PHPChina 开源社区门户T j5kWs&Ty;w8MDMg/Y
clearTimeout(对象) 清除已设置的setTimeout对象  PHPChina 开源社区门户C/g:J0O#z:N.P n-L
clearInterval(对象) 清除已设置的setInterval对象  PHPChina 开源社区门户'V&V&Z7iR&W
confirm("提示信息") 弹出确认框,确定返回true取消返回false  PHPChina 开源社区门户)F(O-tcG:xm3j
cursor:样式 更改鼠标样式 hand crosshair text wait help default auto e/s/w/n-resize  PHPChina 开源社区门户`"cG!GCo)C]

;fEf&M:Wy0event.clientX 返回最后一次点击鼠标X坐标值;  
*urG J h4K0aK0event.clientY 返回最后一次点击鼠标Y坐标值;  
g"kr1RY G%u F0event.offsetX 返回当前鼠标悬停X坐标值  
qjV3]k\KC4]5A@0event.offsetY 返回当前鼠标悬停Y坐标值  
!b"v+\df%{y*b-x0PHPChina 开源社区门户3h!c)R k Rb+K3k
document.write(document.lastModified) 网页最后一次更新时间  PHPChina 开源社区门户C%v8t%s])XY@
document.ondblclick=x 当双击鼠标产生事件  PHPChina 开源社区门户?v9?-w^Q9I%A(Xo
document.onmousedown=x 单击鼠标键产生事件  
{4[9q \ Eu"p0
0N5Qub+D6c0document.body.scrollTop; 返回和设置当前竖向滚动条的坐标值,须与函数配合,  PHPChina 开源社区门户V]{xa:o
document.body.scrollLeft; 返回和设置当前横向滚动务的坐标值,须与函数配合,  
Z gTM:V \0document.title document.title="message"; 当前窗口的标题栏文字  
lv hIJA0document.bgcolor document.bgcolor="颜色值"; 改变窗口背景颜色  
.]%cYy+A/A'A6WR5VZ0document.Fgcolor document.Fgcolor="颜色值"; 改变正文颜色  
w| nJ3@\s0document.linkcolor document.linkcolor="颜色值"; 改变超联接颜色  PHPChina 开源社区门户n#tU%L A,k
document.alinkcolor document.alinkcolor="颜色值"; 改变正点击联接的颜色  PHPChina 开源社区门户"p P7E U'^N
document.VlinkColor document.VlinkColor="颜色值"; 改变已访问联接的颜色  PHPChina 开源社区门户$`4h/{3r3jz1` F
document.forms.length 返回当前页form表单数  
q~A&a,j*l0document.anchors.length 返回当前页锚的数量  
(k:[:E-~ZN(~M0document.links.length 返回当前页联接的数量  PHPChina 开源社区门户 D4]6c0G4s_&h8O@
document.onmousedown=x 单击鼠标触发事件  PHPChina 开源社区门户!|4J4g*E E$LS
document.ondblclick=x 双击鼠标触发事件  PHPChina 开源社区门户4Zm p DN
defaultStatus window.status=defaultStatus; 将状态栏设置默认显示  
)P$X"UL wis0PHPChina 开源社区门户V1G:tM S9b-T!R
function function xx(){...} 定义函数  PHPChina 开源社区门户$p#c'k(l`inH
isNumeric 判断是否是数字  
3r:ji6m+vWu0innerHTML xx=对象.innerHTML 输入某对象标签中的html源代码  PHPChina 开源社区门户KaeT[W^
innerText divid.innerText=xx 将以div定位以id命名的对象值设为XX  PHPChina 开源社区门户n;r0os3_!w+A |gh

I/]b`/{}0location.reload(); 使本页刷新,target可等于一个刷新的网页  PHPChina 开源社区门户5SA5DkIH7ET/b

9F [?qcA3w2Q0Math.random() 随机涵数,只能是0到1之间的数,如果要得到其它数,可以为*10,再取整  PHPChina 开源社区门户#k P!?dG&PXL
Math.floor(number) 将对象number转为整数,舍取所有小数  
?.AT^3c@Z+ME0Math.min(1,2) 返回1,2哪个小  PHPChina 开源社区门户?8SS:i#p^
Math.max(1,2) 返回1,2哪个大  
:M8P1e0e!e-FR qt0PHPChina 开源社区门户4So-X;l5c#K\$\f5_6[-P
navigator.appName 返回当前浏览器名称  
m TOK]-^$C'CW"X)\0navigator.appVersion 返回当前浏览器版本号  
Q6E0LeCO+N0navigator.appCodeName 返回当前浏览器代码名字  
\o6q3P[0navigator.userAgent 返回当前浏览器用户代标志  PHPChina 开源社区门户(c NeHH1r _4Z

x9kDCec X(C0onsubmit onsubmit="return(xx())" 使用函数返回值  PHPChina 开源社区门户.E/`(?;bt(mB
opener opener.document.对象 控制原打开窗体对象  
7Q | h-J4Y0g M.WQp0PHPChina 开源社区门户"D,cxO+e;hOS3t
prompt xx=window.prompt("提示信息","预定值"); 输入语句  PHPChina 开源社区门户&l4nP'w(r
parent parent.框架名.对象 控制框架页面  
.CQ.f6sI"W0PHPChina 开源社区门户@!rVd3V.J5z
return return false 返回值  
v'ZO&EE+Q3mJ%N9L9P'\0random 随机参数(0至1之间)  PHPChina 开源社区门户+vs8d-jG__F
reset() form.reset(); 使form表单内的数据重置  
7AV-UVE(_},[5f0
e G V~0{0split("") string.split("") 将string对象字符以逗号隔开  
aL2~ kr0submit() form对象.submit() 使form对象提交数据  
\Sv'n"W L0PHPChina 开源社区门户'I&~ J0AC,S(]BT
String对象的 charAt(x)对象 反回指定对象的第多少位的字母  
[7h?B"cn1u4g0lastIndexOf("string") 从右到左询找指定字符,没有返回-1  
.?iU%Lk0kw3q*k0indexOf("string") 从左到右询找指定字符,没有返回-1  PHPChina 开源社区门户'[3n~ QK6N
LowerCase() 将对象全部转为小写  
CyA)M[I0UpperCase() 将对象全部转为大写  PHPChina 开源社区门户;X s0G%K"J
substring(0,5) string.substring(x,x) 返回对象中从0到5的字符  
7|5`-b l2e{1EJc(O!Hb-G0setTimeout("function",time) 设置一个超时对象  
|'Nxh%z:t:v Q&v2T\M0setInterval("function",time) 设置一个超时对象  PHPChina 开源社区门户@$c/iK_%w-F
PHPChina 开源社区门户/C!?'lk[3id-lN
toLocaleString() x.toLocaleString() 从x时间对象中获取时间,以字符串型式存在  
&o5D:zym jC0typeof(变量名) 检查变量的类型,值有:String,Boolean,Object,Function,Underfined  PHPChina 开源社区门户m-QK u MLW2t@

Py Wp2z&k:C f4nUS0window.event.button==1/2/3 鼠标键左键等于1右键等于2两个键一起按为3  PHPChina 开源社区门户Y+j|4e%E,X'B
window.screen.availWidth 返回当前屏幕宽度(空白空间)  
$IWqc wV0window.screen.availHeight 返回当前屏幕高度(空白空间)  PHPChina 开源社区门户NCrmRE:G+` ^
window.screen.width 返回当前屏幕宽度(分辨率值)  
fN`t9]t*e G$r0window.screen.height 返回当前屏幕高度(分辨率值)  PHPChina 开源社区门户i!@:H/P7]A%Y-Z \ p ]
window.document.body.offsetHeight; 返回当前网页高度  PHPChina 开源社区门户Or7Mo"P SfI+U#q
window.document.body.offsetWidth; 返回当前网页宽度  
s,g!|&w#|&lT&j:t;O&f0window.resizeTo(0,0) 将窗口设置宽高  PHPChina 开源社区门户OOCyfy,@$N+V
window.moveTo(0,0) 将窗口移到某位置  PHPChina 开源社区门户rEV)YK$XD
window.focus() 使当前窗口获得焦点  PHPChina 开源社区门户!pRr8FS Zb _
window.scroll(x,y) 窗口滚动条坐标,y控制上下移动,须与函数配合  PHPChina 开源社区门户Lr `.^ G(lq e x
window.open() window.open("地址","名称","属性")  
O(K1PJ#{0属性:toolbar(工具栏),location(地址栏),directions,status(状态栏),  PHPChina 开源社区门户 vMf8FU
menubar (菜单栏),scrollbar(滚动条),resizable(改变大小), width(宽),height(高),fullscreen(全  屏),scrollbars(全屏时无滚动条无参 数,channelmode(宽屏),left(打开窗口x坐标),top(打开窗口y坐标)  
&R.eZZ H5p g"bYDs0window.location = ’view-source:’ + window.location.href 应用事件查看网页源代码;  
"y&`A+k&]2} q0
kr[5R%n"f"cB0a=new Date(); //创建a为一个新的时期对象  PHPChina 开源社区门户U$lWn$o}ZC*n_'j!\
y=a.getYear(); //y的值为从对象a中获取年份值 两位数年份  
3b,Q8G"_%_/jM F0y1=a.getFullYear(); //获取全年份数 四位数年份  
Y/p/A~ |*kHDAc0m=a.getMonth(); //获取月份值  
Vbz,Ji;QW/u0d=a.getDate(); //获取日期值  
$i7ATR'Z0d1=a.getDay(); //获取当前星期值  
#Y"l I)G`9C`0h=a.getHours(); //获取当前小时数  
+k#DJ)n9Y)_;u/c0m1=a.getMinutes(); //获取当前分钟数  PHPChina 开源社区门户 hrMIR.I jiG
s=a.getSeconds(); //获取当前秒钟数  
@M\:Gq2Z6o)s J#x0PHPChina 开源社区门户V4?,e T\
对象.style.fontSize="文字大小";  PHPChina 开源社区门户+eY6`"Q]ys HK"{9T
单位:mm/cm/in英寸/pc帕/pt点/px象素/em文字高  
b Y/D {!VZmT01in=1.25cm  
-y;i:dF8G U01pc=12pt  
m#Lqe4v1u!K01pt=1.2px(800*600分辩率下)  PHPChina 开源社区门户?.[f?+n0P{
PHPChina 开源社区门户'X6U sHrs
文本字体属性:  PHPChina 开源社区门户"iR^`$o/|j I~ X
fontSize大小  PHPChina 开源社区门户/Qi^J&H
family字体  
T ~ HCFA(pns2O0color颜色  
XI-M?n[3?0fontStyle风格,取值为normal一般,italic斜体,oblique斜体且加粗  PHPChina 开源社区门户,O/oN_$B(yTH
fontWeight加粗,取值为100到900不等,900最粗,light,normal,bold  
l/ob"aqk0letterSpacing间距,更改文字间距离,取值为,1pt,10px,1cm  
m!@NWI0k%M@0textDecoration:文字修饰;取值,none不修饰,underline下划线,overline上划线  PHPChina 开源社区门户Hn,?0h!f1|G(S9xe
background:文字背景颜色,  
9A2j,T,V7f&vu0backgroundImage:背景图片,取值为图片的插入路径  
P#]F `S#I0
AIT+Qi-Q fm;e0点击网页正文函数调用触发器:  PHPChina 开源社区门户,d?C)\ w9I-]\Z)K1?
PHPChina 开源社区门户5J5\Y\I;U%]4C
1.onClick 当对象被点击  
5rJ%Q3m%o02.onLoad 当网页打开,只能书写在body中  PHPChina 开源社区门户3K7P$fB~
3.onUnload 当网页关闭或离开时,只能书写在body中  
SoV+f3F_'EzK04.onmouseover 当鼠标悬于其上时  
0T8Dp:{:NO05.onmouseout 当鼠标离开对象时  PHPChina 开源社区门户@ExzD1M.]"{ N
6.onmouseup 当鼠标松开  PHPChina 开源社区门户M'J$P&u-} b*s
7.onmousedown 当鼠标按下键  
`EM c r5zk"S08.onFocus 当对象获取焦点时  PHPChina 开源社区门户:p6C F6X/vF$jt~H
9.onSelect 当对象的文本被选中时  
V)dPKj#I010.onChange 当对象的内容被改变  PHPChina 开源社区门户/b x&t1hmQ&n B
11.onBlur 当对象失去焦点  
3ga!CD9lG3[b0y_/x0onsubmit=return(ss())表单调用时返回的值  PHPChina 开源社区门户)F!_ Gv:}#\.|h
PHPChina 开源社区门户 Oo9a&H+s\ K
直线 border-bottom:1x solid black  PHPChina 开源社区门户D{L|K#T zol
虚线 border-bottom:1x dotted black  PHPChina 开源社区门户D2|:J&Hn8X'p
点划线 border-bottom:2x dashed black  PHPChina 开源社区门户:h0xw5dR t@
双线 border-bottom:5x double black  
"y^3L @;g hcey0槽状 border-bottom:1x groove black  
IWS1rHJ4nR0脊状 border-bottom:1x ridge black  
6E1_]B5EZsG0PHPChina 开源社区门户%{[4pE#_%k#EU#]
1.边缘高光glow(color=颜色,strength=亮光大小)  
_-tkE"R&I ]0PHPChina 开源社区门户C'}b V+T(c,Av Z
Tags: javascrīpt js 网页脚本   PHPChina 开源社区门户,G!|H_x*`t
PHPChina 开源社区门户(D;PJ0]9w
shunz – 周三, 2005 – 03 – 30 13:04  PHPChina 开源社区门户o-CL(P2@
学习笔记  PHPChina 开源社区门户 F:x:VIEb9N7t
发表评论 – 更多 – 2530 reads  
*vl1ymNY"{ `0   
qAcp%`0?   PHPChina 开源社区门户2nlLgo3y*@i
网页自动设置为主页  PHPChina 开源社区门户2h)W@f!j,~`
在定义了前面的javascrīpt的cookie函数的前题下:  PHPChina 开源社区门户/qV$bm-z#j$[
在后面加上  PHPChina 开源社区门户!\X`|c;~Y
PHPChina 开源社区门户 ^X4MgeI%\\4c
onMouseOver="if(!this.isHomePage(’http://www.mydomain.com/’)   PHPChina 开源社区门户] w j n(Mi
&&  
+bl;ht1q`0window.external && !GetCookie(’HomePage’))  PHPChina 开源社区门户D_R1i1jTS!xXY g
PHPChina 开源社区门户!|8o{~A @@P4?
{  
#g4h0e f\.c#^0this.setHomePage(’http://www.mydomain.com/’) ;  PHPChina 开源社区门户r6U3U yi0_\ur1JE

Zm C)~ VX"fM_0SetCookie(’HomePage’,’true’);  PHPChina 开源社区门户^`s4Zc.m
}  
"U"|r cYh0return  PHPChina 开源社区门户L&@#Nl/D/G2s
false;">  
CRT&j\yd_s0并且在前面加上

TAG: js

寒沄小屋 引用 删除 hy0kl   /   2007-05-07 12:52:48
顶就一个字.
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 10194
  • 日志数: 51
  • 图片数: 3
  • 书签数: 3
  • 建立时间: 2007-02-07
  • 更新时间: 2008-02-27

RSS订阅

Open Toolbar