Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Add first active class styling

I have portfolio gallery where first item is grid 2 rows and 2 columns and right to that is 2 small images.

Portfolio has filter and if I click filter tab it filters out images but first image is small now. I have question How I can add first active item a style.

HTML:

.elementor-portfolio //class where is articles of each portfolio image
article.elementor-active //portfolio item what is active

CSS:

grid-column: 2!important;
grid-row: 2!important;

What I've tried:

jQuery(function($) {
   $(".elementor-portfolio article.elementor-active").first().css({
   'grid-column' : '2!important',
   'grid-row' : '2!important'
});
});

CODE:

<style>
    .active-one {
    grid-column: span 2;
    grid-row: span 2;
}
.active-twothree {
    grid-column: span 1;
    grid-row: span 1;
}

</style>
<script>

jQuery(function($) {
    $(".custom-grid .elementor-portfolio__filters li").click(function(){
    $(".custom-grid .elementor-portfolio .elementor-active").first().addClass("active-one");
    });
    $('.custom-grid .elementor-portfolio .elementor-active:gt(0)').removeClass('active-one');
});
    
</script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!