getXY : function(element){ var y = element.offsetTop; var x = element.offsetLeft; while(element = element.offsetParent){ y += element.offsetTop; ...
分类:
其他好文 时间:
2014-10-04 22:48:07
阅读次数:
316
众所周知,firefox下的element除了有tab线的,其他没有焦点这个概念(你可以给一般元素加tabindex属性使得它有焦点).那没有,为什么不自己做一个.测试已通过,注释直接英文写的,本人练习英语中,加上这段自制的脚本,可以直接修复firefox下的onblur问题(其实你也可以加入获得f...
分类:
其他好文 时间:
2014-10-04 22:41:17
阅读次数:
294
/*
*
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2014-10-04 17:45:36
阅读次数:
163
/*
*
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2014-10-04 14:32:16
阅读次数:
211
Replacing an element of a list with another:% lreplace {a b c d e} 1 1 fooa foo c d eReplacing two elements of a list with three:% lreplace {a b c d e...
分类:
其他好文 时间:
2014-10-04 13:08:16
阅读次数:
162
‘.’ Matches any single character.‘*’ Matches zero or more of the preceding element.The matching should cover theentireinput string (not partial).The f...
分类:
其他好文 时间:
2014-10-04 06:16:56
阅读次数:
232
都是些简单的东西,所以直接上代码了。/** * Created by huangjacky on 14-10-3. */function Node(element, left, right) { this.element = element; this.level = 0; thi...
分类:
编程语言 时间:
2014-10-03 22:21:25
阅读次数:
313
Brief: the-ith-element,given a array A with n element , return the i-th element of A. A(n,i)this problem can be solved using quick-sort idear, every t...
分类:
其他好文 时间:
2014-10-02 18:28:43
阅读次数:
210
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-10-01 19:08:51
阅读次数:
163
js中,动态添加html的方法大致就是两种,一种是document.createElement等方法创建,然后使用Element.appendChild添加,或者是使用Element.innerHTML = sHTML的方式。两种方法,显然前面一种更加灵活,除了Element.appendChild方法外,还有insertBefore等等其他dom操作方式。这里且不谈灵活性,但就性能做一个探索。...
分类:
Web程序 时间:
2014-09-30 18:11:39
阅读次数:
263