views:

49

answers:

2

Hi, I'm trying to get a jQuery selector for the child of a sibling (multiple sections on the page so need to just reach the sibling's child (rather thna being able to use a general selector).

HTML:

<div class="tour-section">
                <div class="screenshots left">
                    <div class="tab tab1"></div>
                    <div class="tab tab2"></div>
                    <div class="tab tab3"></div>
                    <div class="tab tab4"></div>
                </div>
                <div class="talking-point section1">
                    <h2 class="primary-color-text">Create your listing</h2>
                    <p class="subheader">Create your job listing by adding a few simple details</p>
                </div>
</div>

JS:

$(".talking-point.section1").mouseenter(function() {
            $(this).siblings(".screenshots").children("tab").hide();
            $(".screenshots .tab1").show();
            $(this).siblings(".screenshots").css("background-position","0 0");
        }); 
+1  A: 

Do you mean children(".tab")?

KennyTM
+2  A: 

Logically it should work. You're missing a dot . for the .children() selector.

.children(".tag")
jAndy
That wasn't it unfortunately :(
Walker