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

jQuery .hasClass() method

0 votes
91 views
added May 24, 2018 in jQuery by LC Marshal Captain (25,840 points)
edited Jun 27, 2019 by LC Marshal

To use hasClass() method  for more than 1 class

if($('body').hasClass('page-area-outlook') || $('body').hasClass('page-project-outlook')) {
    var outlookMap = $('#outlook-map');
    $(outlookMap).closest('section');
    $('html,body').animate({},0,"easeOutQuart",function(){
        if(heatmap == null){
            initHeatmap();
        }
    });
}

 

3 Responses

0 votes
responded May 24, 2018 by LC Marshal Captain (25,840 points)
edited Jun 27, 2019 by LC Marshal

if body hasClass() ,hide() element

if($('body').hasClass('newlaunches')) {
  $('.float-agent-contact').hide();
} 
0 votes
responded Jun 28, 2019 by LC Marshal Captain (25,840 points)
if(shareBox.hasClass('in')) {
  shareBox.removeClass('in');
}
if(shareBtn.hasClass('in on-click')) {
  shareBtn.removeClass('in on-click');
}
if(shareBtn.hasClass('in catfish-extension on-click')) {
  shareBtn.removeClass('in catfish-extension on-click');
}

 

0 votes
responded Oct 18, 2019 by LC Marshal Captain (25,840 points)
newsMeta.css('margin-top', '40px');
firstP.append(newsMeta);
// japanCarousel.append(newsMeta);
newsMeta.show();

 

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