Here is the piece of javascript that correctly identifies a UL element:
$(this.parentNode.nextSibling.nextSibling.children[0]);
The html it looks over is: (with 'this' referring to the .cs_previ开发者_运维知识库ousArrow as the initial selector)
<div id="cs_furlBar1">
<p class="cs_furlHeaderClosed">INVESTOR SERVICES</p>
<p class="cs_seeAllFurl"><a href="#">See all</a></p>
</div>
<div id="cs_investorServ" class="cs_hideOpen">
<div class="cs_previousArrow"><img class="previous_btn" src="images/previousArrow.gif" width="11" height="21" alt=""></div>
<div class="cs_vidThumbClip"></div>
in the div of cs_VidThumbClip, I use the load() action to insert a UL which has the class of cs_vidThumbList
So, the above javascript, after some bouts with Firebug, works but I'm thinking there must be a shorter (or better?) of selecting the same element.
The whole point of this is that I have 5 different divs each which will have its own content loaded to be scrolled so I wanted to avoid have the same code duped and then just the id changed.
Thanks
You can try
$('ul.cs_vidThumbList', $(this).parent().parent())
精彩评论