4
rated 0 times
[
5]
[
1]
/ answers: 1 / hits: 38397
/ 8 Years ago, fri, november 18, 2016, 12:00:00
I want to skip the first in the .map
function what I do now is this:
block.gallery.map((item, i) => (
<div className=gallery-item key={i}>
{ block.gallery.length > 4 && i !== 0 ?
<div className=inner>
<img src={block.gallery[i].images.thumbnail_sm} alt={block.title} srcSet={`${block.gallery[i].images.thumbnail_md} 1x, ${block.gallery[i].images.thumbnail_lg} 2x`} className=img-fluid title= />
<div className=img-overlay>
<span className=img-overlay-body>{ block.gallery.length - 4 }+ <span className=hidden-xs>Foto's</span></span>
</div>
</div>
:
<img src=http://placehold.it/800x538 alt= className=img-fluid title= />
}
More From » reactjs