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

DOM manipulation - to hide element when particular class exist

0 votes
3 views
added Mar 26, 2018 in PHP by LC Marshal Lieutenant (15,850 points)
edited May 4, 2018 by LC Marshal

To flag

<?php 
if ($node->uid == "65632") { 
  $newlaunches = "newlaunchpage"; 
}
?>

 

To add class on DOM

<div class="sticky-prop-header detail-header hidden-m <?php echo $newlaunches; ?>">

 

To addClass & hide

if ($(".sticky-prop-header").hasClass('newlaunchpage')) {
  $('body').addClass('newlaunches'); 
}

if($('body').hasClass('newlaunches')) {
  $('.float-agent-contact').hide();
} 

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.
...