I use this code to wrap every 3 divs in a seprate div and this works:
$('.a_paj_element:nth-child(3n)').each(function(index) {
$(this).prevAll('.a_paj_element').andSelf().wrapAll('<div class="three_paj_els" style="display:none;" />');
});
$('#paj_container > .a_paj_element').wrapAll('<div class="three_paj_els" style="display:none;" />');
I Have been trying how to assign each wrapping div its own ID in numeric order kind of like this:
<div id="1" class="three_paj_els" style="display:none;" ></div>
<div id="2" class="three_paj_els" style="display:none;" ></div>
<div id="3" class="three_paj_els" style="display:none;" ></div>
Like it Auto Increments. each ID it makes. When i try and do it I can’t get it to increment.
How do I do this if it’s possible?
Thanks a bunch
-sal
How about this?
I’m not sure whether numbers alone are valid IDs.