Are you first timer at 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
added Mar 26, 2018 in PHP by LC Marshal Captain (25,880 points)
edited May 4, 2018 by LC Marshal

To flag

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')) {

if($('body').hasClass('newlaunches')) {

Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.