-3
I have this example but I would like you not to repeat, I would like you to appear only once!
$('p').each(function(i) {
var pos = i + 1;
console.log(pos, pos % 3, this)
if (pos % 3 == 0) {
$('<div/>', {
class: 'anuncio',
html: '<div id="phtur">Div inserida!</div>'
}).insertAfter(this);
}
});
$('#phtur').hide().delay(10000).slideToggle('slow');
$('#phtur').click(function(){
$("#phtur").slideToggle('slow');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<p> 1</p>
<p> 2</p>
<p> 3</p>
<p> 4</p>
<p> 5</p>
<p> 6</p>
<p> 7</p>
Thanks, it worked out! OBG
– Elson Jackson