Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我用Node.all('p:last') 它提示我SyntaxError: Syntax error: not support pseudo: first #725

Open
dot888 opened this issue May 29, 2015 · 7 comments

Comments

@dot888
Copy link

dot888 commented May 29, 2015

我引入了seed.js

然后代码如下:
KISSY.use("node", function (S, Node) {
S.ready(function() {
var p = Node.one("p");
Node.all("p:last").text("scrollTop:" + p.scrollTop());
});
});

通过Node.all('p:last')根本不能获取p元素的最后一条节点

难道kissy必须结合jquery一起用吗?

@Colin6618
Copy link

S.all

@dot888
Copy link
Author

dot888 commented May 30, 2015

还是不行? 您帮我看下是哪里出了问题?
KISSY.use("node", function (S, Node) {
S.ready(function () {
var $ = S.all;
var p = $('p:first');//这句报错
console.log(p);

        });
    });

@Colin6618
Copy link

first-child

@Colin6618
Copy link

@dot888
Copy link
Author

dot888 commented May 30, 2015

谢谢,我试了下,first-child出不来,但是last-child能把第二个p匹配出来,不知所云 V_V

@dot888
Copy link
Author

dot888 commented May 30, 2015

p:first-child 它匹配的是在其父元素的子节点列表中的第一个p元素,如果不是,则不会匹配。

我现在换成S.all('p').item(0)来解决了,哎 谢谢你了 我的QQ:731314565 有时间聊聊

@dot888
Copy link
Author

dot888 commented May 30, 2015

QQ群:462872362
欢迎 喜欢和支持KISSY的朋友加入。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants