![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
野猪没我野
这个作者很懒,什么都没留下…
展开
-
js表单验证
java script验证表单时常用: "^-[0-9]*[1-9][0-9]*$" //负整数 "^-?//d+$" //整数 "^//d+(//.//d+)?$" //非负浮点数(正浮点数 + 0) "^(([0-9]+//.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*//.[0-9]+)|([0-9]*[1-9][0-9]*))$" /原创 2007-09-15 22:44:00 · 385 阅读 · 0 评论 -
js生成随机数
var chars = [0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z];function generateMixed(n) { var res = "原创 2007-09-15 22:41:00 · 698 阅读 · 0 评论 -
让图片飘起来的js代码
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=ab原创 2007-09-15 22:38:00 · 826 阅读 · 0 评论 -
Div随意拖动
var isDrag = false;var oldX=0,oldY=0;function init(){ isDrag=true; oldX=event.x; oldY=event.y;}function end(){ isDrag=false;}function moveIt(){ if(isDrag){ var x =window.event.x;原创 2007-12-12 00:15:00 · 1836 阅读 · 0 评论 -
类似chinaren的DIV 拖动
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">Drag & Dropbody{ background-color:#36393D; font-size:12px; margin:0px; }DIV.dragLayer{ border:1px solid #369转载 2007-12-12 00:23:00 · 487 阅读 · 0 评论 -
document.body.scrollTop值为0的解决方法
document.body.scrollTop值为0的解决方法 做页面的时候可能会用到位置固定的层,读取document.body.scrollTop来设置层的位置,像这样,window.onscroll=function () { var oFix=document.getElementById原创 2007-12-14 09:52:00 · 578 阅读 · 0 评论