上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: ie:document.selection.empty()ff:window.getSelection().removeAllRanges() 阅读全文
posted @ 2013-03-13 15:06 winenr123 阅读(205) 评论(0) 推荐(0) 编辑
摘要: var sum=Math.floor(Math.random()*16))//16为取得0-16的随机数Math.random()*(n-m)+m;生成 M到N之间的随机数. 阅读全文
posted @ 2013-03-06 17:01 winenr123 阅读(160) 评论(0) 推荐(0) 编辑
摘要: <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--><!--[if IE]> 所有的IE可识别 <![endif]--><!--[if IE 6]> 仅IE6可识别 <![endif]--><!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]--><!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]--><!--[if IE 7]> 仅IE7 阅读全文
posted @ 2013-02-21 15:03 winenr123 阅读(165) 评论(0) 推荐(0) 编辑
摘要: document.elementFromPoint(x,y)方法可以获取到鼠标移动中当前光标所在的元素,他接受2个参数,鼠标的X坐标和Y坐标document.onmousemove=function(event){ var e=event?event:window.event; var x=e.clientX; var y=e.clientY; var obj=document.elementFromPoint(x,y); console.log(obj.nodeName);} 阅读全文
posted @ 2013-02-21 10:29 winenr123 阅读(819) 评论(0) 推荐(0) 编辑
摘要: http://www.zhangxinxu.com/wordpress/?p=743IE下: filter: alpha(opacity=100 finishopacity=100 style=1,startx=0,starty=0,finishx=100,finishy=50) progid:DXImageTransform.Microsoft.gradient(startcolorstr=green,endcolorstr=red,gradientType=0);opacity:开始颜色透明度,100为不透明,0为透明finishopacity:结束透明度(这里... 阅读全文
posted @ 2012-12-25 17:04 winenr123 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 当头部应用外置css文件时在body中的A,B,C,D 4个DIV 分别引用4个img 背景图片4个DIV后有1个img标签,SRC指向为和4个IMG 背景图片在同一个文件夹内加载顺序为IMG 图片最先加载,4个DIV的背景图片稍后加载,并且是并行下载<div id="a"></div><div id="b"></div><div id="c"></div><div id="d"></div><img src=&q 阅读全文
posted @ 2012-12-04 10:33 winenr123 阅读(895) 评论(0) 推荐(0) 编辑
摘要: window.parent.document.getElementByID得到上级元素中某个IDwindow.parent.window.JS变量名 得到上级元素JS文件window.parent.document.getElementByID("ID").contentDocument.getElementById("ID")获取上一级框架中另外一个iframe中的IDwindow.parent.document.getElementByID("ID").contentWindow.JS变量名 获取OR操作上一级框架中另外一个ifr 阅读全文
posted @ 2012-10-16 16:56 winenr123 阅读(2389) 评论(0) 推荐(0) 编辑
摘要: JS获取焦点元素:document.activeElementdocument.activeElement为一个节点可以获取ID nodeName,innerHTML等JS获取选中元素,一般用去P,span,TD中的文字 if (window.getSelection) { alert(window.getSelection()+"@@"); //W3C } else { alert(docume... 阅读全文
posted @ 2012-08-26 11:07 winenr123 阅读(2088) 评论(0) 推荐(0) 编辑
摘要: 在属性中添加<input type="text" autocomplete="off" 阅读全文
posted @ 2012-08-15 11:24 winenr123 阅读(178) 评论(0) 推荐(0) 编辑
摘要: number方法:number方法会转布尔值比如 number(true)弹出数字1;false 弹出数字2parseint方法:parseint一般转化包含数字的字符串,但是比如“070”这杨的字符串会转换为8进制,所以第2个参数最好填写需要转换的进制;++前置和--后置++前置是在运算前就改变了,++后置是在运算后改变var a=10;// a=a+1;var b=++a+10;alert(a);alert(b)弹出a为11;弹出b为21运算A+10的时候 A已经是11了++后置的时候var b=a++ +10;弹出a为11弹出b为20运算A+10的时候,A还是10;运算完后B为20,A为 阅读全文
posted @ 2012-08-12 23:23 winenr123 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页