|
我在一个list中 获取节点以后 获取父节点,但是 点到list的边框时 会报出cannot read property 'parentNode' of undefinded错误,求告知如何解决 谢谢!- touch.on('#' + newsContentID, 'touchstart', function(ev){
- //ev.preventDefault();
- var $swipNode = $('#' + newsContentID + " li").has(ev.target);
- var $swipNode = $('#' + newsContentID + " li").has(ev.target);
- //console.info($swipNode);
- var p = $swipNode[0].parentNode.children;
- for(var i=0,pl=p.length;i<pl;i++){
- if(p[i]!=$swipNode[0]){
- $(p[i]).removeClass('x-swipe-out');
- $(p[i]).css({'transform':'translate3d(0,0,0)'});
- dx = 0;
- }
- }
- dx = parseInt($swipNode.attr('swipeX') || "0");
- });
复制代码 |
|