Versión 2.x


Tb´anil tajb´en

Q´onxa qe archivos te Gridzy toj t-servidor exttzen q´onxa toj t-xmilala (n-chi b´aj toj t-xaq t-xe´l):

<link rel="stylesheet" href="gridzy/gridzy.min.css" />
<script src="gridzy/gridzy.min.js"></script>

Q´onxa aju´ código HTML (noq jaxku tumel toj t-xmilal):

<div class="gridzy">
  <img src="https://loremflickr.com/640/480?random=1" alt="a random image" />
  <img src="https://loremflickr.com/480/640?random=2" alt="another random image" />
  <img src="https://loremflickr.com/640/640?random=3" alt="yet another random image" />
  <img src="https://loremflickr.com/640/480?random=4" alt="a random image again" />
  <img src="https://loremflickr.com/640/480?random=5" alt="one last random image" />
</div>

¡Atzun jlu! Atzun jun techlal tz´aqli t-xilen. Mya il ti´j tu´n t-xi tzyet juntl maj.

Tb´inchb´en

A tten mas nya kwest tun t-xi b´inchet Gridzy, noq tu´n tajb´en HTML. Noq o´kx il ti´j tu´n t-xi tq´o´na tnejel kyb´i aye opciones tuk´e data-gridzy- . Iktzun, tun t-xi q´et aju´ t-xilen spaceBetween , noq o´kx t-xi q´et aju´ atributo data-gridzy-spaceBetween .

<div class="gridzy" data-gridzy-spaceBetween="20" data-gridzy-desiredHeight="400">
  <img src="https://loremflickr.com/640/480?random=1" alt="a random image" />
  <img src="https://loremflickr.com/480/640?random=2" alt="another random image" />
  <img src="https://loremflickr.com/640/640?random=3" alt="yet another random image" />
  <img src="https://loremflickr.com/640/480?random=4" alt="a random image again" />
  <img src="https://loremflickr.com/640/480?random=5" alt="one last random image" />
</div>

Aqeju tnejel t-xilen

tajlal tnejelT-kayb´ajtz
animatetrueN-chi yolin ti´j qa il ti´j tu´n tajb´en qe animaciones aj t-xi tch´ixpu´n aju´ cuadrícula (jun techel, aj t-xi tch´expu´n t-xilen t-xaq t-xaq u´j moqa aj t-xi t-ximan jun filtro).
layoutjustifiedN-chi tzaj tchik´b´a´n aju´ t-xilen n-ku b´inchet. Gridzy.js 2 n-chi tzaj tqona kab´e t-xilen justified exttzen waterfall . Teyele junjun kye at junjun ky-parámetros te t-xilen, aye n-ku tz´el tniky´a tjaq´ t-xaq u´j lu.
filter*In tzaj tq’ama’n alkyeqe tilb’ilal il ti’j tu’n tkub’ yek’et. Noq alkyexku CSS-selector n-ku tz´ajb´en te tajlal tzalu. N-chi b´aj t-ximan tjunalx tuk´e filterControls (ka´yinxa juntl t-xilen).
Qʼonka twitza tiʼj Filtros
filterControlsN-chi tzaj tqona alkyeqe elementos te forma n-chi ajb´en tun t-xi t-ximan kyi´j tilb´ilal. Noq alkyexku jun CSS selector, a n-chi tzaj t-sk´o´n qe elementos te HTML, jaku tz´ajb´en te tajlal tzalu.
Qʼonka twitza tiʼj Filtros
autoConsiderScrollBarstrueTun t-xi qma´n t-xilen t-xilen qa aye barras de desplazamiento n-chi yek´un moqa n-chi el tzpet. Tkyaqil amb´il n-xi q´ma´n tu´n t-xi q´et toj true noq o´kx qa aju´ automatismo lu n-chi tzaj ti´n nya b´a´n.

Justified t-xilen t-xilen

tajlal tnejelT-kayb´ajtz
autoFontSizefalseN-chi b´aj tch´ixpu´n t-xilen t-xilen junjun kajon tza´n t-xilen t-xilen kajon. Noq tu´n t-xi´n, aju´ t-xilen t-xilen u´j mya n-ok q´o´n tojxix tumel.
desiredHeight190N-chi tzaj tqona t-xilen t-xilen t-xilen t-xilen t-xilen. A t-xilen axix tok k-xel b´inchet t-xilen t-xilen t-xilen extzen aye t-xilen t-xilen.
hideOnMissingImagetrueN-chi kub´ t-xmo´n qe tkub´el t-xilen tilb´ilal mya b´ant t-xi q´et.
spaceBetween4N-chi tzaj tqona t-xilen kyxol junjun tiyjil toj pixels.
lastRowAlign
atxix toj t-xilen 2.3.0
justifiedN-chi tzaj tchik´b´a´n t-xilen t-xe´chil t-xe´chil. Aye tajlal n-chi tzaj q´o´n amb´il kye left , center , right extzen justified .
singleRowAlign
atxix toj t-xilen 2.3.0
justifiedN-chi tzaj tqona t-xilen t-xilen qa noq junx t-xilen. Aye tajlal n-chi tzaj q´o´n amb´il kye left , center , right extzen justified .
fillLastRow
atxix toj t-xilen 2.1.0
trueO tz´el q´i´n atxix toj versión 2.4.0 (DEPRECATED since version 2.3.0 )
N-chi kub´ t-ximan qe tilb´ilal tun t-xi tnojsa´n t-xe t-xaq. Qa n-ximana tu´n t-xi tq´o´na qe tilb´ilal toj jun tten dinámico, b´a´n tu´n t-xi t-ximana tu´n t-xi t-ximana.
Mya n-ok t-xilen kyi´j junjun t-xaq (ka´yinxa fillSingleRow ).
fillSingleRow
atxix toj t-xilen 2.1.0
trueO tz´el q´i´n atxix toj versión 2.4.0 (DEPRECATED since version 2.3.0 )
Qa noq jun t-xaq, n-chi kub´ t-ximan qe tilb´ilal tun t-xi t-nojsa´n tkyaqil t-xaq. Qa jaku b´aj qa noq jun moqa kab´e tilb´ilal at toj t-xaq u´j, b´a´n tu´n t-xi ttzaqpi´na.

Waterfall t-xilen t-xilen

tajlal tnejelT-kayb´ajtz
autoFontSizefalseN-chi b´aj tch´ixpu´n t-xilen t-xilen junjun kajon tza´n t-xilen t-xilen kajon. Noq tu´n t-xi´n, aju´ t-xilen t-xilen u´j mya n-ok q´o´n tojxix tumel.
desiredWidth250N-chi tzaj tqona t-xilen t-xilen aye columnas. A t-xilen axix tok k-xel b´inchet t-xilen t-xilen at extzen tajlal t-xilen.
hideOnMissingImagetrueN-chi kub´ t-xmo´n qe tkub´el t-xilen tilb´ilal mya b´ant t-xi q´et.
horizontalOrderfalseN-chi tzaj tqona qa aye elementos n-chi kub´ q´o´n noq jun elemento toj junjun columna te tz´e´y te tz´e´y, exttzen n-xi tzyet juntl majl toj columna mas te tz´e´y t-xe t-xilen alkye columna at mas t-xilen. Noq t-xilen, aye elementos n-chi okx q´o´n toj columna tuk´e aju´ ch´in t-xe´.
spaceBetween4N-chi tzaj tqona t-xilen kyxol junjun tiyjil toj pixels.
singleRowAlign
since version 2.7.0
justifiedDefines the behavior when not all columns can be filled due to too few images. Allowed values are left, center, right and justified.

Mas t-xilen t-xilen

tun t-ximana kyi´j juntl t-xim, q´onka twitza ti´j API .

HTML semántico

A t-xim HTML mas nya kwest te Gridzy atzun jlu:

<div class="gridzy">
  <img src="https://loremflickr.com/640/480?random=1" alt="a random image" />
  <img src="https://loremflickr.com/480/640?random=2" alt="another random image" />
  <img src="https://loremflickr.com/640/640?random=3" alt="yet another random image" />
  <img src="https://loremflickr.com/640/480?random=4" alt="a random image again" />
  <img src="https://loremflickr.com/640/480?random=5" alt="one last random image" />
</div>

Noqtzun tu´nj, a Gridzy nimxix t-xilen extzen b´a´n tu´n tajb´en ch´ixmi alkyexku juntl t-xilen HTML. Oʼkx at junjun tiʼchaq tuʼn qximen tiʼj:

  • Teyile junjun k´wal te t-xmilal t-xmilal n-chi yek´unte jun tiyjil toj t-xmilal.
  • Kykab´il aju´ elemento te tkub´il extzen aye tk´wa´l jaku tz´ok te alkyexku jun t-xilen t-xilen, ikyxjo tze´n ul exttzen li (noq o´kx b´a´n tu´n t-xi t-ximana tu´n t-xi t-ximana juntl majl t-xilen t-xnaq´tzb´il).
  • Qa jun elemento img mya jun tal k´wal, il ti´j tu´n tten aju clase gridzyImage .

Kyja´tzun, ax ikx jun t-xim HTML n-aq´unan:

<ul class="gridzy">
  <li>
    <span>
      <img class="gridzyImage" src="https://loremflickr.com/640/480?random=1" alt="a random image" />
    </span>
  </li>
  <li>
    <span>
      <img class="gridzyImage" src="https://loremflickr.com/480/640?random=2" alt="another random image" />
    </span>
  </li>
  <li>
    <span>
      <img class="gridzyImage" src="https://loremflickr.com/640/640?random=3" alt="yet another random image" />
    </span>
  </li>
  <li>
    <span>
      <img class="gridzyImage" src="https://loremflickr.com/640/480?random=4" alt="a random image again" />
    </span>
  </li>
  <li>
    <span>
      <img class="gridzyImage" src="https://loremflickr.com/640/480?random=5" alt="one last random image" />
    </span>
  </li>
</ul>

Mas qa n-tajb´ena tu´n t-xi tq´o´na junjen t-xaq u´j, il ti´j tu´n tten jun t-xim HTML. tun t-xnaq´tzana mas ti´j, q´onka twitza ti´j Captions & Skins .

Subtítulos & Skins

Qa n-tajb´ena tu´n t-xi tq´o´na junjun t-xaq u´j toj t-galería, il ti´j tu´n t-xi tq´o´na t-xilen t-xilen. Tu´ntzintz, at junjun ky-chib´jel otaq che b´aj b´incha´n. Teyile junjun t-xmilal n-ok te jun archivo CSS. Ilti´j tu´n t-xi tq´o´na aju´ u´j lu´ t-xe´l kye u´j te Gridzy (n-chi b´aj toj t-xaq t-xe´l):

<link rel="stylesheet" href="gridzy/skins/gridzySkinClassic/style.min.css" />

Exttzen il ti´j tu´n tten jun t-xim HTML:

<div class="gridzy gridzySkinClassic">
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/640/480?random=1" alt="a random image" />
    <figcaption class="gridzyCaption">a caption text</figcaption>
  </figure>
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/480/640?random=2" alt="another random image" />
    <figcaption class="gridzyCaption">another caption text</figcaption>
  </figure>
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/640/640?random=3" alt="yet another random image" />
    <figcaption class="gridzyCaption">yet another caption text</figcaption>
  </figure>
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/640/480?random=4" alt="a random image again" />
    <figcaption class="gridzyCaption">a caption text again</figcaption>
  </figure>
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/640/480?random=5" alt="one last random image" />
    <figcaption class="gridzyCaption">one last caption text</figcaption>
  </figure>
</div>

Qa n-ximana ti´j t-xim HTML, q´onka twitza ti´j Semantic HTML .

Te t-xilen t-xilen t-xilen t-xilen t-xilen t-xilen, noq o´kx b´a´n tu´n t-xi q´et t-xilen t-xilen gridzyCaption . A t-xilen img ti´j tu´n t-xi t-xnaq´tza´n gridzyImage .

A yek´b´il twitz n-chi tzaj tyek´un teya t-xmilal gridzySkinClassic . tun tajb´en juntl, noq o´kx tz´okx tq´o´na tb´i t-xmilala tuk´e jun kyxol qe jlu:

Skins n-okx toj

Aqe xnaq´tzb´il at
gridzySkinBlank
jun tb´anil t-xe´chil tun t-xi b´inchet jun t-xmilala
yek´b´il t-xilen
gridzySkinBlank
gridzySkinClassic
yek´b´il t-xilen
gridzySkinClassic
gridzySkinClassicLight(DEPRECATED since version 2.6.0)
gridzySkinFullOverlay
yek´b´il t-xilen
gridzySkinFullOverlay
gridzySkinFullOverlayLight(DEPRECATED since version 2.6.0)
gridzySkinLift
yek´b´il t-xilen
gridzySkinLift
gridzySkinLiftLight(DEPRECATED since version 2.6.0)
gridzySkinMagnifier
aju aq´untl te zoom mya n-okx toj
yek´b´il t-xilen
gridzySkinMagnifier
gridzySkinMagnifierLight(DEPRECATED since version 2.6.0)

Kykyaqil aye t-xmilal twitz tx´otx´ noq n-chi qaninte jun archivo CSS, extzun at junjuntl t-xmilal n-chi qaninte jun archivo JavaScript:

<link rel="stylesheet" href="gridzy/skins/gridzySkinBlur/style.min.css" />
<script src="gridzy/skins/gridzySkinBlur/script.min.js"></script>
Aqe xnaq´tzb´il at
gridzySkinBlur
mya n-aq´unan toj IE
yek´b´il t-xilen
gridzySkinBlur
gridzySkinBlurLight(DEPRECATED since version 2.6.0)
gridzySkinCard
yek´b´il t-xilen
gridzySkinCard
gridzySkinCardLight(DEPRECATED since version 2.6.0)

Tb´anil t-xmilal

Atxix toj versión 2.6.0 at junjun t-xilen tun t-xi b´inchet aye ky-chib´jel. Ik tza´n t-xilen t-xmilal jaku tz´ok tq´o´na t-xb´alin t-xe´, t-xb´alin u´j ex t-xlekumal u´j. Noq o´kx il ti´j tu´n tajb´en CSS t-xilen t-xilen tza´n t-xi tka´yina tzalu:

<div class="gridzy gridzySkinClassic" style="--background: rgba(0, 80, 117, .8); --color: rgb(238, 238, 238); ">
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/640/480?random=1" alt="a random image" />
    <figcaption class="gridzyCaption">a caption text</figcaption>
  </figure>
  <figure>
    <img class="gridzyImage" src="https://loremflickr.com/480/640?random=2" alt="another random image" />
    <figcaption class="gridzyCaption">another caption text</figcaption>
  </figure>

  ...

</div>

Qʼonka twitza kyiʼj qeju variables in che onin ex kyiʼj qeju tajlal in che ajbʼen te junjun skin tzalu:

gridzySkinClassic
Variabletajlal tnejelTqanil
--backgroundrgba(0, 0, 0, .7)n-tzaj tqona junjun t-xilen CSS
--colorrgb(255, 255, 255)n-tzaj tqona junjun t-xilen CSS
--text-shadownonen-tzaj tqona jun tajlal CSS text-shadow
gridzySkinFullOverlay
Variabletajlal tnejelTqanil
--backgroundrgba(0, 0, 0, .7)n-tzaj tqona junjun t-xilen CSS
--colorrgb(255, 255, 255)n-tzaj tqona junjun t-xilen CSS
--text-shadownonen-tzaj tqona jun tajlal CSS text-shadow
gridzySkinLift
Variabletajlal tnejelTqanil
--backgroundrgba(0, 0, 0, .7)n-tzaj tqona junjun t-xilen CSS
--colorrgb(255, 255, 255)n-tzaj tqona junjun t-xilen CSS
--text-shadow0 0 10px rgb(0, 0, 0), 0 0 20px rgb(0, 0, 0), 0 0 30px rgb(0, 0, 0)n-tzaj tqona jun tajlal CSS text-shadow
gridzySkinMagnifier
Variabletajlal tnejelTqanil
--backgroundrgba(0, 0, 0, .7)n-tzaj tqona junjun t-xilen CSS
--colorrgb(255, 255, 255)n-tzaj tqona junjun t-xilen CSS

A t-xmilal lu mya n-ok t-xnaq´tza´n --text-shadow

gridzySkinBlur
Variabletajlal tnejelTqanil
--backgroundrgba(0, 0, 0, .7)n-tzaj tqona junjun t-xilen CSS
--colorrgb(255, 255, 255)n-tzaj tqona junjun t-xilen CSS
--text-shadow0 0 10px rgb(0, 0, 0)n-tzaj tqona jun tajlal CSS text-shadow
gridzySkinCard
Variabletajlal tnejelTqanil
--backgroundrgba(0, 0, 0, 1)n-tzaj tqona junjun t-xilen CSS
--colorrgb(255, 255, 255)n-tzaj tqona junjun t-xilen CSS
--text-shadownonen-tzaj tqona jun tajlal CSS text-shadow

Kykyaqil aye skins predefinidos noq n-chi onin kyi´j subtítulos te texto. B´a´n t-ximana tun t-b´inchena t-xmilala extzen t-xmilala mas t-xilen. B´a´n tu´n tok tq´o´n twitza ti´j Style Gridzy .

Style Gridzy

Qa myia jun t-xmilala t-xi t-ximana t-xi t-ximana, b´a´n tu´n t-xi t-ximana t-xmilala.

A tten mas nya kwest a tnejel tu´n t-xi t-sama´na jun t-xmilala ex tu´n t-xi t-ximana ti´j tajb´ila. A t-xmilal gridzySkinBlank n-chi tzaj tqona jun tb´anil t-xe´l extzen jun tb´anil u´j toj u´j CSS:

/** SKIN Blank **/

/* all gallery items (direct children of the main container element) */
.gridzySkinBlank > .gridzyItem {
  overflow: hidden;
}

/* all gallery images (predefined in Gridzy's main CSS file, but can be overridden) */
.gridzySkinBlank .gridzyImage {
}

/* all gallery captions (just create your very own style) */
.gridzySkinBlank .gridzyCaption {
  margin: 0;
  padding: .5em;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  transition: opacity .5s;
  overflow: auto;
  background: rgba(0, 0, 0, .7);
  color: rgb(255, 255, 255);
}

.gridzySkinBlank > .gridzyItem:hover .gridzyCaption {
  opacity: 1;
}

Toj u´j CSS n-ok tka´yina aye t-xnaq´tzb´il gridzySkinBlank , gridzyImage exttzen gridzyCaption . A Gridzy mya tajb´en kye xnaq´tzb´il lu. Noq n-ku ajb´en te b´inchb´il extzen tu´n t-xi t-xo´na moqa tu´n t-xi tq´o´na juntl kyb´i qa taja.

Extzun k-okil tka´yina aju´ t-xnaq´tzb´il CSS gridzyItem . A Gridzy n-xi tq´o´n aju´ xnaq´tzb´il lu´ noq tu´nx tib´ kye kykyaqil tk´wal t-xilen aju´ t-xilen t-xilen. Iktzun, b´a´n tu´n tajb´en aju´ xnaq´tzb´il lu´ tun t-xi t-ximana kyi´j ti´chaq te t-galería.

Ximana kyi´j ti´chaq nim kyoklen

  1. Aju´ t-xilen aju´ ti´chaq il ti´j tu´n t-xi´ t-xnaq´tza´n tkyaqil. Qo ximen ti´j qa aju tajlal elemento ax tok kch´expajel. B´inchama tajlal porcentaje twitz tajlal pixel. extzen q´onka twitza ti´j aju´ t-xilen t-xilen Gridzy autoFontSize , aju´ n-ok tmojb´a´n t-xilen t-xilen t-xilen t-xilen t-xilen t-xilen.
  2. Teyile junjun tiyjil il ti´j tu´n tten jun t-xilen t-xilen. A t-xilen t-xilen aju´ tiyjil mya n-chi ch´expaj extzen il ti´j tu´n t-xi b´inchet aju´ t-xilen aju´ cuadrícula. Iktzun tten qa jun ti´xti´ mya t-xilen t-xilen t-xilen, b´a´n t-xilen t-xilen t-xilen (se´n css).

Toj junjun amb´il, b´a´n tu´n t-xi b´inchet jun t-xilen t-xilen aye ti´chaq na´mxtoq t-xi tzyet Gridzy. Noq o´kx tz´el tpa´na aju gridzy te xnaq´tzb´il moqa aju archivo javascript te Gridzy noq ch´in amb´il te jlu.

¡Atzun jlu! Noq o´kx jlu il ti´j tu´n t-xi tb´incha´na t-xmilala. Ch´ixme kykyaqil aye t-xmilal predefinidos mya n-chi ajb´en mas twitz jlu.

Extzun jaku tzaj mastl qa tajb´ila ...

Skins avanzados

A Gridzy n-ku tz´ajb´en mas CSS t-xnaq´tzb´il twitz gridzyItem . Ch´ixme kykyaqil n-chi b´aj b´incha´n kyjunalx extzen jaku che ajb´en tu´na tun t-xi b´inchet ky-b´inchb´en.

Clases te contenedores principales

tb´i xnaq´tzb´ilT-kayb´ajtz
gridzy
tun t-xi q´et manualmente
A Gridzy n-chi jyon kyi´j elementos tuk´e aju´ t-xnaq´tzb´il lu extzen n-chi tzaj t-xnaq´tza´n kye.
gridzyAnimatedKb´el t-ximan tjunalx qa true aju opción animate . Qa aju´ xnaq´tzb´il lu n-ok q´o´n te q´ob´, aju´ opción animate k-xel t-xi´ true tjunalx (extzun qa ma tz´ok q´o´n te false ).

xnaq´tzb´il

tb´i xnaq´tzb´ilT-kayb´ajtz
gridzyItemKb´el q´o´n t-xe t-xilen aju´ tiyjil t-xi tzyet aju´ t-xilen t-xilen. Mlay tz´el q´i´n.
gridzyItemInitializingKb´el q´o´n t-xe t-xilen aju´ tiyjil t-xi tzyet aju´ t-xilen t-xilen. Kxel q´et t-xel gridzyItemReady aj t-xi tzyet tkyaqil t-xilen. Mya t-xilen qa aye tilb´ilal tz´aqliqe (ka´yinxa gridzyItemLoading ), noqtzun aye tiyjil b´antni tun t-xi q´et twitz.
gridzyItemReadyN-chi tzaj tch´expu´n gridzyItemInitializing noq o´kx aj t-xi tzyet tkyaqil t-xilen. Mlay tz´el q´i´n. Mya t-xilen qa aye tilb´ilal tz´aqliqe (ka´yinxa gridzyItemComplete ), noqtzun aye tiyjil b´antni tun t-xi yek´un.
gridzyItemLoadingKb´el q´o´n t-xe t-xilen aju´ tiyjil t-xi tzyet aju´ t-xilen t-xilen. Kxel q´et t-xel tu´n gridzyItemComplete noq o´kx aj t-xi´ t-ximan kyi´j tilb´ilal (o´kx jun).
gridzyItemCompleteN-chi tzaj tch´expu´n gridzyItemLoading noq o´kx aj t-xi´ t-ximan kyi´j tilb´ilal (o´kx jun) t-xi´ t-ximan. Mlay tz´el q´i´n.
gridzyItemInitialToVisibleKb´el b´inchet noq o´kx aj t-xi tzyet tu´n t-xi yek´un aju ti´chaq tnejel maj. K-xel q´i´n t-xe t-xilen t-xilen t-xilen t-xilen.
gridzyItemVisibleKb´el q´o´n t-xe t-xilen t-xilen t-xilen t-xilen. K-el q´i´n noq o´kx aj t-xi tzyet tu´n t-xi´ t-xilen aju´ ti´xti´.
gridzyItemVisibleToHiddenKb´el b´inchet noq o´kx aj t-xi tzyet tu´n t-xi´ t-xilen aju´ ti´xti´. K-el q´i´n t-xe t-xilen t-xilen t-xilen t-xilen.
gridzyItemHiddenKb´el q´o´n t-xe´l t-xi´ t-xmoxin aju´ ti´chaq. K-el q´i´n t-xe´l t-xi tzyet tu´n t-xi yek´un aju´ ti´xti´.
gridzyItemHiddenToVisibleKb´el q´o´n t-xe´l t-xi tzyet tu´n t-xi yek´un aju´ tiyjil (extzun t-xi tzyet tu´n t-xi yek´un tnejel maj – q´onka twitza ti´j xnaq´tzb´il gridzyItemInitialToVisible ). K-xel q´i´n t-xe t-xilen t-xilen t-xilen t-xilen.
gridzyItemVisibleToVisibleKb´el q´o´n t-xe t-xilen jun ti´x toj t-xaq u´j n-chi ch´expaj, extzun aju´ t-xilen t-xilen ex n-chi b´aj t-ximan. K-xel q´i´n t-xe t-xilen aju´ animación te ch´ixpub´l.

Noq t-xilen aju´ yek´b´il te b´inchb´en extzen aye animaciones tun t-xi yek´un ex tun t-xi´ naj tilb´ilal n-chi b´aj b´incha´n tu´n aju´ archivo CSS te Gridzy.

tuk´e aye xnaq´tzb´il CSS ma qo yolin ti´j, b´a´n tu´n t-xi t-b´inchena t-ximlal t-ximlal exttzen kye animaciones. B´a´n tu´n toka tka´yina toj u´j CSS te Gridzy, tun t-xi t-ximana ti´chaq k-xel t-ximana. Mi´n tzaj xob´a, tkyaqil b´a´n t-xilen tz´ib´a´n.

B´inchama t-xilen t-xilen

Qa ma tz´ajb´en nim tilb´ilal tu´na, b´a´n tu´n tonina te Gridzy tu´n t-xi t-b´incha aju´ t-xaq t-xaq.

Miʼn che jaw ẍchʼin qe tilbʼilal

A Gridzy ilxix ti´j tu´n t-xi t-ximan aju tajlal t-xilen kykyaqil tilb´ilal tun t-xi t-ximan aju tajlal. Aye tqanil lu n-chi tzaj kyq´o´n junjen elementos saltos qa at junjun tilb´ilal b´antniqe ex junjuntl mya. Qa at nim tilb´ilal, mas tzaj nya b´a´n ti´j aju´ t-xilen lu.

Tun mi´n t-xi´ b´inchet aju´ b´inchb´en lu, noq o´kx q´onxa width ex t- height kye kykyaqil elementos img . Nim toklen tu´n t-xi q´et aju´ tajlal tz´aqli te junjun tilb´ilal, qatzun mya´, aye tilb´ilal n-chi b´aj ky-ximan. Aye tajlal tz´aqli aye tnejel t-xilen ex t-xilen t-xilen junjun tilb´ilal:

<div class="gridzy">
  <img src="https://loremflickr.com/640/480?random=1" width="640" height="480" alt="a random image" />
  <img src="https://loremflickr.com/480/640?random=2" width="480" height="640" alt="another random image" />
  <img src="https://loremflickr.com/640/640?random=3" width="640" height="640" alt="yet another random image" />
  <img src="https://loremflickr.com/640/480?random=4" width="640" height="480" alt="a random image again" />
  <img src="https://loremflickr.com/640/480?random=5" width="640" height="480" alt="one last random image" />
</div>

Tb´ajlenxi´tzun a Gridzy n-ku tz´ok t-ximan aju´ cuadrícula jun rat naj mya il ti´j tu´n tel tniky´ ti´j t-xilen qe tilb´ilal.

Lazy Loading

tun t-xi t-xo´na noq qe tilb´ilal ate´ toj t-xaq t-xaq, noq o´kx b´inchama qe t-xim lu:

  1. Q´onk t-xilen width ex height tza´n t-xilen twitz (b´a´n tu´n tajb´en qe t-xilen b´a´n)
  2. Q´onk t-xel kykyaqil src atributos tuk´e data-gridzylazysrc tza´n t-xi yek´un tzalu (qa at srcset atributos teya, q´onk t-xel tuk´e data-gridzylazysrcset ).
<div class="gridzy">
  <img data-gridzylazysrc="https://loremflickr.com/640/480?random=1" width="640" height="480" alt="a random image" />
  <img data-gridzylazysrc="https://loremflickr.com/480/640?random=2" width="480" height="640" alt="another random image" />
  <img data-gridzylazysrc="https://loremflickr.com/640/640?random=3" width="640" height="640" alt="yet another random image" />
  <img data-gridzylazysrc="https://loremflickr.com/640/480?random=4" width="640" height="480" alt="a random image again" />
  <img data-gridzylazysrc="https://loremflickr.com/640/480?random=5" width="640" height="480" alt="one last random image" />
</div>

Tej t-xi´ b´inchet aye b´e lu, aye tilb´ilal n-chi b´et t-xe´l t-xe´l t-xe´l extzen t-xe´l t-xe´l t-xilen.

yek´b´il te b´inchb´en

A yek´b´il te b´inchb´en atzun jun tal tilb´ilal n-chi yek´unte aj t-xi q´et tilb´ilal. Qa ma tz´ajb´en subtítulos & skins tu´na, aju yek´b´il te b´inchb´en k-xel yek´un tjunalx. Qa mya´, il ti´j tu´n t-xi b´inchet junjun ch´ixpub´il:

  1. Q´onxa junjun t-xim img toj jun t-xim div
    (moqa toj juntl tiyjil – q´onka twitza ti´j HTML semántico tun t-xi tka´yina)
  2. Q´onxa aju´ t-xnaq´tzb´il gridzyImage toj junjun elemento img
<div class="gridzy">
  <div><img src="https://loremflickr.com/640/480?random=1" class="gridzyImage" alt="a random image" /></div>
  <div><img src="https://loremflickr.com/480/640?random=2" class="gridzyImage" alt="another random image" /></div>
  <div><img src="https://loremflickr.com/640/640?random=3" class="gridzyImage" alt="yet another random image" /></div>
  <div><img src="https://loremflickr.com/640/480?random=4" class="gridzyImage" alt="a random image again" /></div>
  <div><img src="https://loremflickr.com/640/480?random=5" class="gridzyImage" alt="one last random image" /></div>
</div>

Tb´ajlenxi ikyjo, b´a´n tu´n tok tq´o´n twitza kyi´j yek´b´il te b´inchb´en qa aye tilb´ilal n-chi kyi´n amb´il tun t-xi tzyet.

Filtros

Aye filtros toj Gridzy noq ch´in ky-b´inchb´en exttzen at ky-ipumal. Noq alkye tten filtro tajb´ila, b´a´n tu´n t-xi b´inchet. Noq o´kx tajb´ila, jun ch´in CSS ex junjun elementos te formulario HTML ...

Atzun jun techlal aq´untl:

<div id="myFilterControls">
  <button value="*">All</button>
  <button value=".animals">Animals</button>
  <button value=".architecture">Architecture</button>
  <button value=".people">People</button>
</div>

<div class="gridzy" data-gridzy-filterControls="#myFilterControls button">
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=1" alt="a random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=1" alt="a random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=1" alt="a random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=2" alt="another random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=2" alt="another random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=2" alt="another random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=3" alt="yet another random animal image" />
</div>

Qo b´inchen junjun t-xaq

1. Tnejel il ti´j tu´n tten aju´ t-xim HTML te Gridzy extzen tu´n t-xi q´et kyb´i kykyaqil t-xim te galería tun t-xi q-b´inchen junjen t-xilen

<div class="gridzy">
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=1" alt="a random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=1" alt="a random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=1" alt="a random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=2" alt="another random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=2" alt="another random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=2" alt="another random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=3" alt="yet another random animal image" />
</div>

Toj techel lu noq jun k´loj n-qajb´en te junjun elemento. Pero ax ikx jaku kubʼ tqʼoʼna nimku clase te junx elemento, qa aju elemento lu il tiʼj tuʼn tkanet tuʼn nimku filtro.

2. Yajxitl n-ku q-q´o´n junjun botones tun t-xi q-ch´expu´n aye filtros extzen

<button value="*">All</button>
<button value=".animals">Animals</button>
<button value=".architecture">Architecture</button>
<button value=".people">People</button>

<div class="gridzy">
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=1" alt="a random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=1" alt="a random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=1" alt="a random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=2" alt="another random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=2" alt="another random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=2" alt="another random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=3" alt="yet another random animal image" />
</div>

Toj t-xel aye botones, b´a´n tu´n tajb´en juntl elementos te u´j tze´nku junjen cuadros, aye botones te radio, aye campos te t-xilen ex txqantl.

Ikytzin t-xi tka´yina, aye tajlal kye botones aye t-xilen CSS. Aj t-xi q-b´inchen, jun t-xilen jun botón ikyjo n-chi yek´unte qe tilb´ilal n-chi ok tmojb´an tib´ tuk´il CSS selector. Tecnicamente noq n-ok tq´o´n aju opción filter te tajlal lu.

Ax ikx jaku tz´ajb´en junjun selectores mas kwest. Jun techel :not(.animals) n-chi aq´unan ax ikx, extzen .animals.people exttzen .animals, .people .

3. Te tmankb´il, n-ku q-okx q´et aye botones toj jun div contenedor extzen n-ku q-ok q-b´inchen toj Gridzy gallery, tun t-xi q-b´inchen aju´ opción filterControls :

<div id="myFilterControls">
  <button value="*">All</button>
  <button value=".animals">Animals</button>
  <button value=".architecture">Architecture</button>
  <button value=".people">People</button>
</div>

<div class="gridzy" data-gridzy-filterControls="#myFilterControls button">
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=1" alt="a random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=1" alt="a random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=1" alt="a random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=2" alt="another random animal image" />
  <img class="architecture" src="https://loremflickr.com/640/480/arch?random=2" alt="another random architecture image" />
  <img class="people" src="https://loremflickr.com/640/480/people?random=2" alt="another random people image" />
  <img class="animals" src="https://loremflickr.com/640/480/animals?random=3" alt="yet another random animal image" />
</div>

Ik tza´n n-ok tka´yina, ax ikx n-qajb´en jun CSS selector te t-xilen filterControls . A div container tuk´e atributo id noq n-ku tz´ajb´en tun t-xi b´inchet aye botones mas nya kwest tu´n t-xi ky-sk´o´n tuk´e aju CSS selector.

¡Atzun jlu!

Qa tajb´ila jun tzaqpib´l te JavaScript, q´onka twitza ti´j API .

API

Maske at jun t-API te Gridzy, nimku tiyjil n-ku b´inchet qa mya at, noq tu´n t-xi t-ximan DOM. A Gridzy k-okil tka´yin extzen k-xel t-ximan aju´ cuadrícula. Extzun at jun API nimxix tipumal ...

N-chi b´inchet aju DOM

Te tkyaqil aq´untl ti´j Document Object Model (DOM) tnejel il ti´j tu´n t-xi q´et aju´ elemento te tkub´il:

// get the container element
var gridzyElement = document.querySelector('.gridzy');

Q´onxa tilb´ilal

Nim toklen tu´n t-xi b´inchet ex tu´n t-xi tnojsa´n aju ak´aj elemento tal na´mxtoq t-xi tq´o´na toj elemento te contenedor. Qa mya ikyjo, a Gridzy mya n-ku tz´el tniky´ ti´j t-xilen t-xilen.

// create a new img element
var newImage = document.createElement('img');

// add src attribute (!! before you add it to the container element !!)
newImage.src = 'https://loremflickr.com/640/480';

// add it as last element to the container element
gridzyElement.appendChild(newImage);

// or as first element (or anywhere in between)
gridzyElement.insertBefore(newImage, gridzyElement.firstChild);

Q´i´nqe tilb´ilal

// remove the first image
gridzyElement.removeChild(gridzyElement.firstElementChild);

Ch´expu´nqe t-xim

// change the spaceBetween option to a specific value
gridzyElement.setAttribute('data-gridzy-spaceBetween', '10');

// change the layout option to a specific value
gridzyElement.setAttribute('data-gridzy-layout', 'waterfall');

// reset the spaceBetween option to its default value
gridzyElement.removeAttribute('data-gridzy-spaceBetween');

Mas ti´j t-xilen DOM n-ku tz´el tniky´a ti´j toj MDN web docs . Ax ikx at jun tnejel xnaq´tzb´il ti´j DOM .

API te t-xilen

Tun tajb´en API, tnejel il ti´j tu´n tten aju´ instancia Gridzy, aju´ n-ok tmojb´an tib´ tuk´il aju´ elemento te tkub´el Gridzy:

// get the Gridzy instance
var gridzyInstance = document.querySelector('.gridzy').gridzy;

tz´okx t-ximana

// get the value of a single option
var currentLayout = gridzyInstance.getOption('layout');

Tzaj ttzaqpi´na kykyaqil t-xim

// get all option values as an object
var currentOptions = gridzyInstance.getOptions();

Q´onk t-xilen

// set specific option values
gridzyInstance.setOptions({
  spaceBetween: 10,
  layout: 'waterfall'
});

// or reset options to their default values
gridzyInstance.setOptions({
  spaceBetween: null,
  layout: null
});

Q´onxa filtro

Aju´ t-xi q´et jun filtro noq o´kx tu´n t-xi q´et aju´ filter te opción aju´ jaku tz´ok te jun selector CSS b´a´n:

// set the filter to match items with class "animals"
gridzyInstance.setOptions({
  filter: '.animals'
});

// reset the filter to match all items again
gridzyInstance.setOptions({
  filter: '*'
});

// set the filter to match items without class "animals"
gridzyInstance.setOptions({
  filter: ':not(.animals)'
});

// set the filter to match items with class "animals" or "people"
gridzyInstance.setOptions({
  filter: '.animals, .people'
});

// set the filter to match items that have both classes, "animals" and "people"
gridzyInstance.setOptions({
  filter: '.animals.people'
});

Q´onxa aye aq´untl te Callback

mya b´a´n t-xilen t-xe t -xilen 2.4.0
B´a´n tu´n tajb´en aye eventos ak´aj ex mas flexible te t-xel. Qʼonka twitza tiʼj juntl plaj tuʼn tel tnikʼa tiʼj.

Gridzy.js 2 n-chi tzaj tqona junjun t-xilen tun t-xi b´inchet aq´untl te q´olb´eb´il. Noq o´kx jaku che kub´ q´et toj API te t-xilen, noqtzun aye txqantl tten:

// same as set other options
gridzyInstance.setOptions({
  onOptionsChanged: function() {
    // will be executed each time the options have changed.
  },
  onBeforeOptionsChanged: function() {
    // will be executed, before new options take effect.
  }
});
T-kayb´ajtz
onBeforeOptionsChangedAju´ aq´untl te q´olb´eb´il n-chi tzaj q´o´n t-xilen twitz t-xi q´et t-xilen.
onOptionsChangedAju´ aq´untl te q´olb´eb´il n-chi tzaj q´o´n t-xilen t-xe t-xilen t-xilen.
onBeforeRenderAju´ aq´untl te q´olb´eb´il n-chi tzaj q´o´n t-xilen t-xe t-xilen.
onRenderAju´ aq´untl te q´olb´eb´il n-chi tzaj q´o´n t-xilen t-xe t-xilen.

B´a´n tu´n tajb´en Eventos

atxix toj versión 2.4.0

B´a´n t-xi t-ximana kyi´j b´ajsb´il Gridzy ikyx tze´nqe b´ajsb´il JavaScript:

document.addEventListener('gridzyOptionsChanged', function(event) {
    // will be executed each time the options have changed.
});

document.addEventListener('gridzyBeforeOptionsChanged', function(event) {
    // will be executed, before new options take effect.
});

At junjun b´ajsb´il n-chi b´aj t-xo´n tib´aj t-xmilal Gridzy extzen at junjun b´ajsb´il n-chi b´aj t-xo´n tib´aj junjun t-xmilal t-xmilal t-xmilal.

Aye b´ajsb´il n-chi b´et toj t-xmilal Gridzy:

T-kayb´ajtz
gridzyBeforeInitN-chi tzaj q´aq´ twitz t-xe t-xilen galería.
gridzyInitN-chi tzaj q´aq´ t-xe t-xilen galería.
gridzyBeforeOptionsChangedN-chi tzaj q´aq´ twitz t-xi tq´o´n junjun opciones.
gridzyOptionsChangedN-chi tzaj q´aq´ t-xe´l t-ximan kyi´j opciones.
gridzyBeforeRenderN-chi q´aq´ twitz t-xilen.
gridzyRenderN-chi tzaj q´aq´ t-xe t-xilen.
Qa ma tz´el tpa´na junjen b´inchb´en tzalu, b´a´n tu´n t-xi tsama´na jun xjelb´itz te onb´il .

event.target n-tzaj tqona aju t-xilen Gridzy.
event.detail.instance n-tzaj tqona aju Gridzy instance.

Aye b´ajsb´il n-chi b´aj kyi´j elementos:

T-kayb´ajtz
gridzyItemBeforeInitN-chi tzaj q´aq´ twitz t-xi tzyet jun ti´xti´.
gridzyItemInitN-chi tzaj q´aq´ t-xe t-xilen t-xilen.
gridzyItemLoadingN-chi tzaj q´aq´ aj t-xi tzyet tu´n t-xi q´et aju´ ti´chaq.
gridzyItemReadyN-chi tzaj q´aq´ aj t-xi´ b´inchet aju´ ti´chaq tun t-xi´ b´inchet aju´ tajlal. Iktzun tten ojtzqi´n aju tajlal t-xilen, noqtzun aye tilb´ilal b´a´n t-xi t-ximan.
gridzyItemCompleteN-ok q´aq´in aj t-xi´ t-xo´n tilb´ilal ti´xti´x.
Qa ma tz´el tpa´na junjen b´inchb´en tzalu, b´a´n tu´n t-xi tsama´na jun xjelb´itz te onb´il .

event.target n-tzaj tqona aju t-xilen t-xilen.
event.detail.instance n-tzaj tqona aju Gridzy instance.

API – Global

At junjun aq´untl mya junx ky-xilen tuk´il Gridzy. kyja´tzun mya il ti´j tu´n t-xi q-k´amo´n jun yek´b´il tnejel.

Tz´okx tq´o´na aju opción default

// get the default value of a single option
var defaultLayout = Gridzy.getDefaultOption('layout');

Tz´elx tkyaqil t-xilen t-xilen

// get all default option values as an object, including the default layout options of the default layout
var defaultOptions = Gridzy.getDefaultOptions();

// or get all default option values, including the default layout options of a specific layout
var defaultOptions = Gridzy.getDefaultOptions('waterfall');

Q´onk t-xilen t-xilen

A jlu mya n-ok tq´o´n ky-b´inchb´en kykyaqil aye instancias Gridzy ya otaq che b´aj b´incha´n, noqtzun aye´ n-ok tq´o´n t-xilen kye ak´aj instancias. Noqtzun tu´nj, qa jun opción te jun instancia atxix ojtxi n-chi b´aj t-ximan juntl majl tuk´e aju´ tajlal null , n-chi ajb´en aju´ ak´aj tajlal t-xe´chil.

// set default option values
Gridzy.setDefaultOptions({
  spaceBetween: 10,
  layout: 'waterfall'
});

B´a´n t-xi t-ximana tun t-xi t-ximana kyi´j t-xim twitz tx´otx´, qa ma txi tq´ama´na na´mxtoq t-xi b´inchet DOM. Iktzun tten mya il ti´j tu´n t-xi tq´o´na junjun opciones te atributos.

Automatismos

Noqtzen kykyaqil aye automatismos te Gridzy.js 2 n-chi aq´unan, mya il ti´j tu´n t-xi b´inchet aye tten lu. Extzun aye automatismos n-ku tz´el kyi´n tun t-xi q´et Gridzy toj jun tten mas t-xilen:

// disable automatic initializations
Gridzy.setDefaultOptions({
  autoInitOnDomReady: false,
  autoInitOnDomMutation: false
});

// or switch off all mutation observers
Gridzy.setDefaultOptions({
  autoInitOnDomMutation: false,
  autoSyncChildListMutation: false,
  autoSyncAttributesMutation: false,
  autoSyncChildClassMutation: false,
  autoSyncImageMutation: false
});

Junjun kyxol qeju t-xilen lu mya b´a´n tu´n t-xi q´et toj data-gridzy- atributos moqa toj setOptions() , tu´n tpaj junjun t-xilen:

tajlal tnejelT-kayb´ajtz
autoInitOnDomReadytrueN-chi tzaj t-xnaq´tza´n kyi´j elementos tuk´e clase gridzy toj t-xaq u´j extzen n-chi tzaj t-xnaq´tza´n.

B´a´n t-xi q´et toj Gridzy.setDefaultOptions()
autoInitOnDomMutation
MutationObserver
trueN-chi tzaj t-xnaq´tza´n kyi´j ak´aj elementos tuk´e clase gridzy noq o´kx aj t-xi yek´un toj DOM extzen n-chi tzaj t-xnaq´tza´n. (ik tze´n tu´n tajb´en t-xilen t-xaq u´j)

B´a´n t-xi q´et toj Gridzy.setDefaultOptions()
autoSyncChildListMutation
MutationObserver
trueN-ok tka´yin qa aye tal elementos (tilb´ilal) n-chi okx q´o´n moqa n-chi el q´i´n, extzen n-chi b´aj tch´ixpu´n aju´ cuadrícula noq tu´nx tib´.

B´a´n t-xi q´et toj data-grizy- , new Gridzy() , setOptions() , Gridzy.setDefaultOptions()
useOptionAttributestrueN-chi tzaj tqona qa aye atributos data-gridzy- n-chi ajb´en tkyaqil maj moqa mya. Qa false jlu, aqeju opciones jaku che kubʼ qʼoʼn noq tuʼn API te tajaw.

B´a´n t-xi q´et toj new Gridzy() , setOptions() , Gridzy.setDefaultOptions()
autoSyncAttributesMutation
MutationObserver
trueN-chi tzaj t-xnaq´tza´n kyi´j ch´ixpub´l kye atributos data-gridzy- , extzen n-chi b´aj t-xnaq´tza´n aju´ t-xaq t-xmilal. Ax ikx n-el tniky´ ti´j qa aju´ gridzyAnimated t-xnaq´tzb´il n-okx q´o´n moqa n-ku tz´el q´i´n ex qa n-ok ch´ixpub´il ti´j style . Qa a useOptionAttributes nya false , noq o´kx n-el tniky´ style t-xilen t-xilen.

B´a´n t-xi q´et toj data-grizy- , new Gridzy() , setOptions() , Gridzy.setDefaultOptions()
autoSyncChildClassMutation
MutationObserver
trueN-chi tzaj t-xnaq´tza´n kyi´j ch´ixpub´l kye class kye kykyaqil t-xnaq´tzb´il k´wal (tilb´ilal). At toklen ti´j filtros.

B´a´n t-xi q´et toj data-grizy- , new Gridzy() , setOptions() , Gridzy.setDefaultOptions()
autoSyncImageMutation
MutationObserver

atxix toj t-xilen 2.5.0
trueN-chi tzaj t-xnaq´tza´n kyi´j ch´ixpub´il src kye kykyaqil tilb´ilal. At toklen aj t-xi q´et tuk´e React moqa tuk´e junjen bibliotecas t-xilen.

B´a´n t-xi q´et toj data-grizy- , new Gridzy() , setOptions() , Gridzy.setDefaultOptions()
autoRenderOnResize
ResizeObserver

atxix toj versión 2.6.0
trueN-chi tzaj t-xnaq´tza´n kyi´j ch´ixpub´l te t-xilen t-xilen. At toklen ti´j t-xilen t-xilen. (Tej na´mxtoq tpon amb´il 2.6.0 jun b´itzb´il te t-xilen t-xilen ventan n-ku ajb´en)

B´a´n t-xi q´et toj data-grizy- , new Gridzy() , setOptions() , Gridzy.setDefaultOptions()

Tzaj t-xnaq´tza´n t-xnaq´tzb´il

// initialize a new Gridzy instance
var gridzyInstance = new Gridzy(document.querySelector('.gridzy'), {
  spaceBetween: 10,
  layout: 'waterfall'
});

B´aj t-xiten aju´ instancia

Noq ch´in t-xilen, aju´ t-xilen t-xi tzyet Gridzy.

gridzyInstance.destroy();
gridzyInstance = null;

Q´onk t-xilen k´wal toj q´ob´

// after child elements (images) are added to or removed from the DOM.
gridzyInstance.syncChildList();

Q´onk t-xilen jun elemento te k´wal toj q´ob´

Noq tkyaqil amb´il mya il ti´j, noq o´kx toj junjun amb´il nya nim maj.

// after child elements (images) are added to the DOM and only one of them should be synced to Gridzy.
gridzyInstance.syncChild(childElement);

Sincronizar atributos manualmente

Q´onka twitza ti´j qa aju´ useOptionAttributes aju´ t-xilen il ti´j tu´n t-xi´ true .

// after data-gridzy- attributes have changed
gridzyInstance.syncAttributes();

Forza Renderización

Noq tkyaqil amb´il mya il ti´j, maske kykyaqil automatismos n-chi kub´ tz´aq

gridzyInstance.render();