1

i want to concat some string(id) with parent id... so i'v tried this-------------->

$(' #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 ....

string should becomes after execute '#cate_id2 > ul' + li:has(ul) + ' > ul'
i mean li:has(ul) will replaced by with its value.......

3
  • 4
    this makes 0 since, please rerite Commented Oct 24, 2012 at 15:14
  • 1
    This sounds like a very convoluted method. What is it you're actually trying to do with the selector? I'm 99% sure there's a better way using traversal. Commented Oct 24, 2012 at 15:14
  • 2
    In the "hover" handler, you can use $(this).children("ul") to find and act on the child <ul> elements. Commented Oct 24, 2012 at 15:15

1 Answer 1

4

Try it like this

$(' #cate_id2 > ul > li:has(ul) ').hover(function () {
    $(this).children('ul').stop().slideDown('fast');
}
Sign up to request clarification or add additional context in comments.

3 Comments

Wow. Do you have a PhD in understanding gibberish?
... or .children("ul") to capture the "> ul" from the original weirdness.
@RoryMcCrossan don't read the text, just the code :) From the desired outcome string it SUDDENLY becomes clear that the OP wants just a direct ul child of the element he already selected :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.