jQuery .hasClass() method

0 votes
458 views
added May 24, 2018 in jQuery by LC Marshal Captain (25,790 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,790 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,790 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,790 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.
...