[英]jquery string concatenation in selector
i want to concat some string(id) with parent id... so i'v tried this--------------> 我想用父id来连接一些字符串(id)...所以我试试这个-------------->
$(' #cate_id2 > ul > li:has(ul) ').hover(function () {
$('#cate_id2 > ul' + this + ' > ul').stop().slideDown('fast');
},
want to concat #cate_id2 > ul
with this
and than append > ul
.... 想用
this
来连接 #cate_id2 > ul
而不是追加 > ul
....
string should becomes after execute '#cate_id2 > ul' + li:has(ul) + ' > ul'
执行
'#cate_id2 > ul' + li:has(ul) + ' > ul'
之后应该成为字符串
i mean li:has(ul)
will replaced by with its value....... 我的意思是
li:has(ul)
将被其值替换.......
Try it like this 试试吧
$(' #cate_id2 > ul > li:has(ul) ').hover(function () {
$(this).children('ul').stop().slideDown('fast');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.