Reputation: 207
I having some logic issues with a small bit of jQuery.
I’m pretty sure I need a loop setup, but am having difficulties snapping this together. I've referenced tuts, videos, working examples, slideshows, even raw javascript but am still having difficulties snapping together the logic end.
Fiddle Links provided, below some brief notes…
Problem:
Goal:
Required:
Limitations:
Original example includes…
HTML
<div id="right">
<div class="module conference program makeBigButton">
<p>
<img src="#" alt="Placeholder"/>
</p>
<h5>
<a title="Yahoo" target="_blank" href="http://www.yahoo.com">Yahoo</a>
</h5>
</div>
<div class="module conference program makeBigButton">
<p>
<img src="#" alt="Placeholder"/>
</p>
<h5>
<a title="Google" target="_blank" href="http://www.google.com">Google</a>
</h5>
</div>
Semi functional jQuery snip
$('.makeBigButton h5 a').clone().addClass('bigButton').insertAfter('.makeBigButton h5');
Semi functional includes…
Thanks everyone.
Upvotes: 4
Views: 129
Reputation: 26727
There you go:
$('.makeBigButton h5').each(function(){
$(this).find('a').clone().addClass('bigButton').insertAfter(this);
});
And welcome to Stackoverflow! ;)
Upvotes: 3