에 적용부모 DIV id를 얻고 나는이 HTML 코드 얻었다 요소
<div class="gallery" id="gallery_x">
<p>
<a href="http://a-dynamic-link.com">image1</a>
<a href="http://another-dynamic-link-com">image2</a>
</p>
</div>
(X = 변수 수)
을하고 난 .gallery의 사업부에서 ID를 얻을에 적용 할 필요가 다만이 같은 "A"로 확인해 :
<div class="gallery" id="gallery_x">
<p>
<a rel="gallery_x" href="http://a-dynamic-link.com">image1</a>
<a rel="gallery_x" href="http://another-dynamic-link-com">image2</a>
</p>
</div>
내 (작동하지 않는) 솔루션은 지금까지입니다 :
$(".gallery a").parents(".gallery").attr("rel", $(this).attr("id"));
누군가 나를 도울 수 있다면 기쁠 것입니다.
감사합니다.
디
이것이 내가 필요한 것입니다. 감사합니다! – dee