Tagged: portfolio grid
I have a portfolio grid that has a lot of items maybe more than a hundred and I am showing it without pagination, I’d like to have number label inside the images that could serve as guide when browing that page. How can I achieve this with Enfold? Thanks in advance.
Hey philscan,
You can use a ::before or ::after CSS rule, so you can check and add a number inside, but how would that number been generated?
Best regards,
Basilis
Hello,
Thanks to your response, I was able to generate the number dynamically by using .attr and use it as my CSS content value for the pseudo element.
Here’s the JS/jQuery code I use:
jQuery(document).ready(function($){
var num = 0;
$(.post-entry-521 .grid-sort-container .post-entry").each(function(){
num +=1;
$(this).attr('data-number',num);
});
});
And the CSS for the ::before
.post-entry-521 .grid-sort-container .post-entry::before {
content: attr(data-number);
}
Hope this help somebody in the future.
Hi philscan,
Thanks for sharing the solution that worked for you :) We really appreciate it.
Best regards,
Nikko