当前位置: 代码迷 >> 综合 >> 手机虚拟定位软件不用root
  详细解决方案

手机虚拟定位软件不用root

热度:100   发布时间:2023-09-10 08:48:58.0
手机虚拟定位软件不用root
除IE外的浏览器是将换行符作为内容的文本节点(nodeType为3)。而元素的话,nodeType为1。下面是查找它们的实用方法:
复制代码 代码如下:

lastSibling:function(node){
var tempObj = node.parentNode.lastChild;
while(tempObj.nodeType!=1 && tempObj.previousSibling!=null)
{
tempObj=tempObj.previousSibling;
}
return (tempObj.nodeType==1)?tempObj:false;
}

这是《深入浅出JavaScript》书中DOMhelp库中lastSibling方法的源码。与 mootools 库中实现源码差不多:
复制代码 代码如下:

'last-child': function(){
var element = this;
while ((element = element.nextSibling)){
if (element.nodeType == 1) return false;
}
return true;
}

这是在 Mootools 1.2.4 源码中的 last-child() 方法。 手机虚拟定位软件不用root
  相关解决方案