相关疑难解决方法(0)

跨浏览器比较文档位置

DOM4 compareDocumentPosition

我想实现compareDocumentPosition.Resig 在这方面做了一个很好的开端.我已经把他的代码整理好了

function compareDocumentPosition(other) {
    var ret = 0;
    if (this.contains) {
        if (this !== other && this.contains(other)) {
            ret += 16;
        }
        if (this !== other && other.contains(this)) {
            ret += 8;
        }
        if (this.sourceIndex >= 0 && other.sourceIndex >= 0) {
            if (this.sourceIndex < other.sourceIndex) {
                ret += 4;
            }
            if (this.sourceIndex > other.sourceIndex) {
                ret += 2;
            }
        } else {
            ret += 1;
        }
    } 
    return ret;
}
Run Code Online (Sandbox Code Playgroud)

这适用于Element但不适用于 …

javascript shim internet-explorer-8 dom4

6
推荐指数
1
解决办法
1941
查看次数

Jquery - 在已知元素之后找到下一个输入:text元素

我有一个id为给<tr id="tagTR"> 定上述,是否有可能找到下一个input:text元素,无论其间是否有任何其他标记.是否有一个jQuery选择器,我可以用于这种情况?

例如 :

<tr id="tagTR"> 
</tr>
<tr id="tagRed"> 

  <td> </td>
</tr>
<div>
 <tr>
   <td>
     <input> // This is what I want to get to. 
   </td>
 </tr>
</div>
Run Code Online (Sandbox Code Playgroud)

jquery element input next

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

dom4 ×1

element ×1

input ×1

internet-explorer-8 ×1

javascript ×1

jquery ×1

next ×1

shim ×1