Page 1 of 1

{Solved}:How can u add for example advertisements after 10

Posted: Mon Apr 30, 2012 4:27 pm
by mekha
How can u add for example advertisements after 10 divs in jquery?

Re: How can u add for example advertisements after 10 divs i

Posted: Mon Apr 30, 2012 4:57 pm
by mekha
i added this:

Code: Select all

$('.div1').each(function(i,e){
  if (((i+1) % 3) == 0)
    $(this).after('<div class="div4"><p style="line-height:3px;">دعاية هنا</p></div>');
});
but the slideToggle in the div before this code .after ... doesnt work :\

Re: How can u add for example advertisements after 10 divs i

Posted: Tue May 01, 2012 12:16 pm
by pickle
Not a lot of details, so I'm going to assume you simply have 10 divs on a page.

Code: Select all

var advertisement = a jquery object representing the advertisement
$("div:eq(9)").after(advertisement);

Re: How can u add for example advertisements after 10 divs i

Posted: Wed May 02, 2012 7:15 am
by mekha
thank you ;)))))))