I really love jQuery, and it feels like there is always more I can do with it. That being said, it's giving me trouble right now. I won't go into details, I just wanted to vent - but basically I am trying to do a very convoluted selection, and while I know it's technically possible with jQ, I can't figure out where I am fucking up. Really what I need is better node structure, but this is a quick patch-job project and I don't have the time or energy for that. Sigh.
edit: alright, I'm officially stumped, so I'm going to ask for some help. Trying to select an attribute in a nearby node, and it's just not working out. This is the layout:
Code:
<li>
<a href="/whatever">
<img style="width: 160px; height: 120px;" alt="Beauty" title="Beauty" src="/whatever">
<div class="floatingBox">
<h1 class="thumbTitle">**Where I want the Title to appear**</h1>
</div>
</a>
</li>
essentially, the query I want to use would look like:
$j('.thumbTitle').append($j(this).parent().siblings('img').attr('title'));
I've tried a few different traversing methods, to no avail. I mean:
$j('.thumbTitle').append($j('img[title]').attr('title'));
Works - but it just finds the first img with a title in the DOM and puts that in all my "thumbTitle" boxes. So I figure moving up in the tree from each individual "thumbTitle" would be the better approach... just not working out.
edit: Worked around my issues, I just used an each loop on the list and worked from there. I guess it's neater/prettier this way but... fuck, I wish I knew why my other method wasn't working.