Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - Add element before element with .insertBefore()

0 votes
5 views
added Mar 6 in jQuery by lcjr Sergeant (2,320 points)
if ($('body').hasClass('front') || (dfpInArticleId.css('display') == 'none')) {
  inArticleUnit.hide();
  console.log('front or none');
}
else { 
  if ($(window).width() < 768) {
    inArticleUnit.insertBefore(inArticleInsertM);
    inArticleUnit.show();
  }
  else {
    inArticleInsert.append(inArticleUnit);
    inArticleUnit.show();
  }
  console.log('in-article appear');
}

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...