0
的標籤重新放置
我一直在試圖重新定位現有的CMS製作HTML內的img
標籤在DOM使用jQuery
<div class="catItemView groupLeading _inspirations">
<!-- (2) and place it here -->
<div class="catItemHeader">
<h3 class="catItemTitle">
<a href="some link here">ways of seeing</a>
</h3>
</div>
<div class="catItemBody">
<div class="catItemIntroText">
<p>
<a href="youtube link here">
<img alt="" src="image_link.jpg" /><!-- (1) would like to grab this-->
John Berger - ways of seeing
</a>
</p>
</div>
</div>
<div class="catItemLinks">
</div>
</div>
我嘗試這樣做:
$('div.catItemIntroText img').prepend('div.catItemHeader');
但它只是混淆了所有其他的「框架」,並將所有圖像填充到「框架」(如這個框架)。 在此先感謝!
感謝,基本上第二個選項更合適,但它沒有解決這個問題。 想到它,也許它會更適合搜索每個'div.catItemHeader',並從那個位置抓取並替換'img'標籤 – 2013-03-10 11:31:21
我已經編輯了我的代碼,我試圖預先添加到錯誤的選擇器,我已經把正確的一個放在了現在。 – 2013-03-10 11:35:48
非常感謝你:) – 2013-03-10 11:38:20