同型内联样式不会覆盖

时间:2019-05-08 18:54:49

标签: javascript jquery hubspot hubl

这里的情况是我正在使用hubspot创建博客,并使用同种类型来过滤我的帖子。

我的代码有效。

但是,我这里的问题是同种型生成的样式

这里是gif

display: none保持内联,即使返回到all标签。

我的JS代码是

<script>           
  $(function(){
    var mostPopular = $('.blog-filters button.active').filter("[data-filter='all']");
    var postsGrid = $('.posts-grid article');

    if (mostPopular).hasClass('active') {
      $(postsGrid).filter("[data-category='all']").remove();
    };
  });
</script>

因此,当我返回到all选项卡并且该按钮具有活动类时,由于内联样式的原因,文章仍未显示,是否有任何方法可以覆盖它。因为通过jQuery不能正常工作。

0 个答案:

没有答案
相关问题