ވެބްސައިޓް ވަނީ އޮޓޮމެޓިކުން ތަރުޖަމާކޮށްފައެވެ. ކަމެއް ސާފު ނުވާނަމަ އިނގިރޭސި ލިޔެކިޔުންތަކަށް ބަލާލަމާ ހިނގާށެވެ.
އަސާސީ ބޭނުންކުރުން
ގްރިޑްޒީ ފައިލްތައް ތިބާގެ ސަރވަރަށް އަޕްލޯޑްކޮށް ތިބާގެ ވެބްސައިޓަށް އެޑްކުރުން (އާންމުކޮށް ހެޑް ސެކްޝަންގައި):
<link rel="stylesheet" href="gridzy/gridzy.min.css" />
<script src="gridzy/gridzy.min.js"></script>އެޗްޓީއެމްއެލް ކޯޑް (ބޮޑީ ސެކްޝަންގެ ކޮންމެ ތަނެއްގައި) އިތުރުކުރުން:
<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>އެއީ! އެއީ ފުރިހަމައަށް ޙަރަކާތްތެރިވާ މިސާލެކެވެ. އިތުރު އިނިޝިއަލައިޒޭޝަން އެއް ނުޖެހެއެވެ.
ކޮންފިގްރޭޝަން
ގްރިޑްޒީ ކޮންފިގްރޭޓް ކުރުމަށް އެންމެ ފަސޭހަ ގޮތަކީ، ހަމައެކަނި އެޗްޓީއެމްއެލް އެޓްރިބިއުޓްސް ބޭނުން ކުރުމެވެ. ހަމައެކަނި ބޭނުންވަނީ އޮޕްޝަން ނަންތަކުގެ ކުރިއަށް data-gridzy- އިންނެވެ. އެހެންކަމުން، spaceBetween އޮޕްޝަން ސެޓް ކުރުމަށްޓަކައި، ހަމައެކަނި އެޓްރިބިއުޓް 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>މައިގަނޑު އިޚްތިޔާރުތައް
Justified ލޭއައުޓް އޮޕްޝަންސް
Waterfall ލޭއައުޓް އޮޕްޝަންސް
އިތުރު އެޑްވާންސް އޮޕްޝަންސް
އިތުރު ކުރިއަރާފައިވާ އިޚްތިޔާރުތަކަށް، އެޕީއައި އަށް ބައްލަވާށެވެ.
ސެމެންޓިކް އެޗްޓީއެމްއެލް އެވެ
ގްރިޑްޒީގެ އެންމެ ސާދާ އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރަކީ މިއީ:
<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>އެހެންނަމަވެސް ގްރިޑްޒީ އަކީ ވަރަށް ފްލެކްސިބަލް އެއްޗަކަށް ވާތީ ގާތްގަނޑަކަށް އެހެން އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރއެއް ބޭނުން ކުރެވޭނެއެވެ. ވިސްނަންޖެހޭ މަދު ނުކުތާތަކެއް އެބަހުއްޓެވެ.
- ކޮންޓެއިނަރ އެލިމެންޓްގެ ކޮންމެ ކުއްޖަކީ ގްރިޑްގައިވާ އެއް އެއްޗެއް ތަމްސީލުކުރާ އެއްޗެކެވެ.
- ކޮންޓެއިނަރ އެލިމެންޓާއި އޭގެ ދަރިން ވެސް ކޮންމެ ޓެގް ޓައިޕަކަށް ވެދާނެއެވެ،
ulއަދިli(ހަމައެކަނި ބްރައުޒާ ޑިފޯލްޓްތައް ރީސެޓް ކުރުމަށް ވިސްނާށެވެ). imgއެލިމެންޓަކީ ޚުދު ސީދާ ކުއްޖަކު ނޫންނަމަ، އެއަށް ބޭނުންވަނީ ކްލާސްgridzyImage.
އެހެންކަމުން މިއީ ވެސް މަސައްކަތްކުރާ އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރއެކެވެ:
<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>ހާއްސަކޮށް ކެޕްޝަން އިތުރުކުރަން ބޭނުންނަމަ ބޭނުންވަނީ ޒަމާނީ އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރެކެވެ. އެކަމާ ބެހޭ އިތުރު މައުލޫމާތު ހޯދުމަށް ކެޕްޝަންސް އެންޑް ސްކިންސް އަށް ބަލާލަމާ ހިނގާށެވެ.
ކެޕްޝަންސް އެންޑް ސްކިންސް
ތިމާގެ ގެލެރީއަށް ކެޕްޝަންތައް އިތުރުކުރަން ބޭނުންނަމަ ސިފަ ކަނޑައަޅަން ޖެހެ އެވެ. އެހެންކަމުން ކުރިން ކަނޑައެޅިފައިވާ ބައެއް ހަންތައް ލިބެން ހުރެއެވެ. ކޮންމެ ހަންގަނޑެއް އެކުލެވިގެންވަނީ ސީއެސްއެސް ފައިލެއްގެ މައްޗަށެވެ. މި ފައިލް ގްރިޑްޒީގެ މައިގަނޑު ފައިލްތަކުގެ އިތުރުން އިތުރުކުރަން ޖެހޭނެ (އާންމުކޮށް ހެޑް ސެކްޝަންގައި):
<link rel="stylesheet" href="gridzy/skins/gridzySkinClassic/style.min.css" />މީގެ އިތުރުން ބޭނުންވަނީ ކުރިއަރާފައިވާ އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރއެއް:
<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>އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރ އާއި މެދު ސުވާލު އުފެދޭނަމަ ސެމެންޓިކް އެޗްޓީއެމްއެލް އަށް ބަލާލަމާ ހިނގާށެވެ.
ކެޕްޝަނަށް ކޮންމެ ވައްތަރެއްގެ ޓެގެއް ބޭނުންކުރެވޭނެ، ހަމައެކަނި ޔަގީންކޮށްލަންވީ އޭގައި ކްލާސް gridzyCaption ހުރިކަން. img އެލިމެންޓަށް ބޭނުންވަނީ ކްލާސް gridzyImage .
މަތީގައިވާ މިސާލުން ފެންނަނީ gridzySkinClassic ހަންގަނޑެވެ . ތަފާތު އެއްޗެއް ބޭނުން ކުރުމަށްޓަކައި، ހަމައެކަނި ހަމުގެ ނަން ބަދަލުކޮށް މިއިން އެއް ނަން ޖަހާށެވެ:
ހިމެނޭ ސްކިންސް އެވެ
| ލިބެންހުރި ކްލާސްތަކެވެ | |
|---|---|
| gridzySkinބްލެންކް އެވެ އަމިއްލަ ހަންގަނޑެއް އުފެއްދުމަށް ރަނގަޅު ފެށުމެކެވެ ލައިވް ޕްރިވިއު | gridzySkinBlank |
| gridzySkinClassic ލައިވް ޕްރިވިއު | gridzySkinClassic(ވަރޝަން 2.6.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ) |
| gridzySkinFullOverlay ލައިވް ޕްރިވިއު | gridzySkinFullOverlay(ވަރޝަން 2.6.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ) |
| gridzySkinLift ލައިވް ޕްރިވިއު | gridzySkinLift(ވަރޝަން 2.6.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ) |
| gridzySkinMagnifier ޒޫމް ފަންކްޝަނަލިޓީ ނުހިމެނޭ ލައިވް ޕްރިވިއު | gridzySkinMagnifier(ވަރޝަން 2.6.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ) |
މަތީގައިވާ ހުރިހާ ސްކިންތަކަށް ބޭނުންވަނީ ހަމައެކަނި ސީއެސްއެސް ފައިލެއް ނަމަވެސް ޖާވާސްކްރިޕްޓް ފައިލް ވެސް ބޭނުންވާ އިތުރު ސްކިންތަކެއް އެބަހުއްޓެވެ:
<link rel="stylesheet" href="gridzy/skins/gridzySkinBlur/style.min.css" />
<script src="gridzy/skins/gridzySkinBlur/script.min.js"></script>| ލިބެންހުރި ކްލާސްތަކެވެ | |
|---|---|
| gridzySkinBlur އައިއީގައި މަސައްކަތް ނުކުރެއެވެ ލައިވް ޕްރިވިއު | gridzySkinBlur(ވަރޝަން 2.6.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ) |
| gridzySkinCard ލައިވް ޕްރިވިއު | gridzySkinCard(ވަރޝަން 2.6.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ) |
ހަމުގެ އިޚްތިޔާރުތައް
ވަރޝަން 2.6.0 އިން ފެށިގެން ބިލްޓް-އިން ސްކިންސް ކޮންފިގްރޭޓް ކުރުމަށް އޮޕްޝަންސް ތަކެއް ހުރެއެވެ. ވަކި ހަންގަނޑަކަށް ބަލާއިރު ބެކްގްރައުންޑް ކުލައާއި ޓެކްސްޓް ކުލައާއި ޓެކްސްޓް ޝެޑޯ ސެޓް ކުރެވިދާނެއެވެ. ހަމައެކަނި ބޭނުންކުރަން ޖެހޭނީ މިތަނުން ފެންނަ ގޮތަށް ސީއެސްއެސް ކަސްޓަމް ޕްރޮޕަޓީސް އެވެ:
<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>ކޮންމެ ހަންގަނޑަކަށް ސަޕޯޓްކުރާ ވެރިއޭބަލްތަކާއި ޑިފޯލްޓް ވެލިއުތައް މިތަނުން ބައްލަވާށެވެ:
gridzySkinClassic
| ވެރިއޭބަލް އެވެ | ޑިފޯލްޓް ވެލިއު | މަޢުލޫމާތު |
|---|---|---|
--background | rgba(0, 0, 0, .7) | އެއްވެސް ސީއެސްއެސް ބެކްގްރައުންޑް ވެލިއުއެއް ހުއްދަކުރެއެވެ |
--color | rgb(255, 255, 255) | ކޮންމެ ސީއެސްއެސް ކުލަ އަގެއް ހުއްދަކުރެއެވެ |
--text-shadow | none | ކޮންމެ ސީއެސްއެސް ޓެކްސްޓް-ޝެޑޯ އަގެއް ހުއްދަކުރެއެވެ |
gridzySkinFullOverlay
| ވެރިއޭބަލް އެވެ | ޑިފޯލްޓް ވެލިއު | މަޢުލޫމާތު |
|---|---|---|
--background | rgba(0, 0, 0, .7) | އެއްވެސް ސީއެސްއެސް ބެކްގްރައުންޑް ވެލިއުއެއް ހުއްދަކުރެއެވެ |
--color | rgb(255, 255, 255) | ކޮންމެ ސީއެސްއެސް ކުލަ އަގެއް ހުއްދަކުރެއެވެ |
--text-shadow | none | ކޮންމެ ސީއެސްއެސް ޓެކްސްޓް-ޝެޑޯ އަގެއް ހުއްދަކުރެއެވެ |
gridzySkinLift
| ވެރިއޭބަލް އެވެ | ޑިފޯލްޓް ވެލިއު | މަޢުލޫމާތު |
|---|---|---|
--background | rgba(0, 0, 0, .7) | އެއްވެސް ސީއެސްއެސް ބެކްގްރައުންޑް ވެލިއުއެއް ހުއްދަކުރެއެވެ |
--color | rgb(255, 255, 255) | ކޮންމެ ސީއެސްއެސް ކުލަ އަގެއް ހުއްދަކުރެއެވެ |
--text-shadow | 0 0 10px rgb(0, 0, 0), 0 0 20px rgb(0, 0, 0), 0 0 30px rgb(0, 0, 0) | ކޮންމެ ސީއެސްއެސް ޓެކްސްޓް-ޝެޑޯ އަގެއް ހުއްދަކުރެއެވެ |
gridzySkinMagnifier
| ވެރިއޭބަލް އެވެ | ޑިފޯލްޓް ވެލިއު | މަޢުލޫމާތު |
|---|---|---|
--background | rgba(0, 0, 0, .7) | އެއްވެސް ސީއެސްއެސް ބެކްގްރައުންޑް ވެލިއުއެއް ހުއްދަކުރެއެވެ |
--color | rgb(255, 255, 255) | ކޮންމެ ސީއެސްއެސް ކުލަ އަގެއް ހުއްދަކުރެއެވެ |
މި ހަންގަނޑު --text-shadow ސަޕޯޓް ނުކުރެއެވެ
gridzySkinBlur
| ވެރިއޭބަލް އެވެ | ޑިފޯލްޓް ވެލިއު | މަޢުލޫމާތު |
|---|---|---|
--background | rgba(0, 0, 0, .7) | އެއްވެސް ސީއެސްއެސް ބެކްގްރައުންޑް ވެލިއުއެއް ހުއްދަކުރެއެވެ |
--color | rgb(255, 255, 255) | ކޮންމެ ސީއެސްއެސް ކުލަ އަގެއް ހުއްދަކުރެއެވެ |
--text-shadow | 0 0 10px rgb(0, 0, 0) | ކޮންމެ ސީއެސްއެސް ޓެކްސްޓް-ޝެޑޯ އަގެއް ހުއްދަކުރެއެވެ |
gridzySkinCard
| ވެރިއޭބަލް އެވެ | ޑިފޯލްޓް ވެލިއު | މަޢުލޫމާތު |
|---|---|---|
--background | rgba(0, 0, 0, 1) | އެއްވެސް ސީއެސްއެސް ބެކްގްރައުންޑް ވެލިއުއެއް ހުއްދަކުރެއެވެ |
--color | rgb(255, 255, 255) | ކޮންމެ ސީއެސްއެސް ކުލަ އަގެއް ހުއްދަކުރެއެވެ |
--text-shadow | none | ކޮންމެ ސީއެސްއެސް ޓެކްސްޓް-ޝެޑޯ އަގެއް ހުއްދަކުރެއެވެ |
ކުރިން ކަނޑައެޅިފައިވާ ހުރިހާ ހަންތަކެއް ސަޕޯޓް ކުރަނީ ހަމައެކަނި ސާދާ ޓެކްސްޓް ކެޕްޝަންތަކަށެވެ. ތިމާގެ ވަރަށް އަމިއްލަ އަދި މިއަށްވުރެ ކޮމްޕްލެކްސް ހަންގަނޑު އުފެއްދިދާނެ އެވެ. ސްޓައިލް ގްރިޑްޒީ އަށް ބަލާލަމާ ހިނގާށެވެ .
ސްޓައިލް ގްރިޑްޒީ އެވެ
ކުރިން ކަނޑައެޅިފައިވާ ހަންގަނޑެއް ބޭނުންތަކަށް ނުފެތޭނަމަ އަމިއްލަ ހަންގަނޑެއް ސްޓައިލް ކުރެވިދާނެ އެވެ.
އެންމެ ފަސޭހަ ގޮތަކީ ފުރަތަމަ މިހާރު ހުރި ހަންގަނޑެއް ކޮޕީކޮށް އަމިއްލަ ބޭނުންތަކަށް އެޑެޕްޓް ކުރުމެވެ. ކުރިން ކަނޑައެޅިފައިވާ ހަންގަނޑު gridzySkinBlank އާންމުކޮށް ރަނގަޅު ފައުންޑޭޝަނެއްގެ އިތުރުން ސީއެސްއެސް ފައިލްގައި ރަނގަޅު ޑޮކިއުމަންޓޭޝަނެއް ލިބިގެންދާނެއެވެ:
/** 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;
}ސީއެސްއެސް ފައިލްގައި gridzySkinBlank , gridzyImage އަދި gridzyCaption ކްލާސްތައް ފެންނާނެއެވެ. ޚުދު ގްރިޑްޒީއަށްވެސް މި ކްލާސްތައް ބޭނުން ނުވެއެވެ. އެއީ ހަމައެކަނި ސްޓައިލިންގ އަށް ބޭނުންކުރާ އެއްޗެހި ކަމުން ބޭނުންނަމަ ނައްތާލެވޭނެ ނުވަތަ ނަން ބަދަލުކުރެވޭނެއެވެ.
މީގެ އިތުރުން ސީއެސްއެސް ކްލާސް gridzyItem ވެސް ފެންނާނެއެވެ. ގްރިޑްޒީ މި ކްލާސް އޮޓޮމެޓިކުން މައިގަނޑު ކޮންޓެއިނަރ އެލިމެންޓްގެ ހުރިހާ ޑައިރެކްޓް ޗިލްޑްރަންސް އަށް ސެޓްކުރެއެވެ. އެހެންކަމުން، މި ކްލާސް ބޭނުންކޮށްގެން ތިމާގެ ގެލެރީގެ ތަކެތި ސްޓައިލް ކުރެވިދާނެއެވެ.
ސިކުނޑީގެ މުހިންމު ކަންތައްތައް
- އައިޓަމްގެ ކޮންޓެންޓްސް ފުރިހަމައަށް ރެސްޕޮންސިވް ވާންޖެހޭނެއެވެ. އެލިމެންޓް ސައިޒަށް ކަނޑައެޅިގެން ބަދަލު އަންނާނެ ކަމަށް ވިސްނާށެވެ. ޕިކްސެލް އަގުތަކުގެ ބަދަލުގައި ޕަސެންޓް އަގުތައް ބޭނުންކުރުން. އަދި ގްރިޑްޒީ ލޭއައުޓް އޮޕްޝަން
autoFontSizeއަށް ބަލާލާއިރު، މިއީ ފޮންޓް-ސައިޒް އައިޓަމް ބޮކްސް ސައިޒަށް ބައިންޑް ކުރާ އެއްޗެކެވެ. - ކޮންމެ އެއްޗެއްގައި ވެސް ރަނގަޅަށް ކަނޑައެޅިފައިވާ އެސްޕެކްޓް ރޭޝިއޯއެއް ހުންނަން ޖެހެ އެވެ. އެ އެއްޗެއްގެ އެސްޕެކްޓް ރޭޝިއޯއަށް ދުވަހަކުވެސް ބަދަލެއް ނާންނާނެ ކަމަށާއި އެއީ ގްރިޑް ހޯދުމަށް ބޭނުންވާ އެއްޗެއް ކަމަށެވެ. އެހެންކަމުން އެއްޗެއްގައި އޮޓޮމެޓިކުން ރަނގަޅަށް ކަނޑައެޅިފައިވާ އެސްޕެކްޓް ރޭޝިއޯއެއް ނެތްނަމަ، މެނުއަލްކޮށް (އެބަހީ css މެދުވެރިކޮށް) ޕްރީޑެފިނޭޓް ކުރާށެވެ.
ބައެއް ހާލަތްތަކުގައި ގްރިޑްޒީ އިނިޝިއަލައިޒް ކުރުމުގެ ކުރިން ތަކެތީގެ ކޮންޓެންޓް ސްޓައިލް ކުރަން ފަސޭހަވެދާނެ އެވެ. މިކަމަށްޓަކައި ވަގުތީ ގޮތުން ކްލާސް gridzy ނުވަތަ ގްރިޑްޒީ ޖާވާސްކްރިޕްޓް ފައިލް ނައްތާލާށެވެ.
އެއީ! އެއީ ތިމާގެ ވަރަށް އަމިއްލަ ހަންގަނޑެއް ބިނާކުރުމަށް ބޭނުންވާ ހުރިހާ އެއްޗެކެވެ. ކުރިން ކަނޑައެޅިފައިވާ ގިނަ ހަންގަނޑުތަކުގައި މިއަށްވުރެ ގިނައިން ބޭނުން ނުކުރެއެވެ.
އެކަމަކު ކަމުދާނަމަ އިތުރު ކަންތައްތަކެއް ހުރެދާނެ ...
އެޑްވާންސްޑް ސްކިންސް އެވެ
ގްރިޑްޒީ އިން ބޭނުންކުރަނީ ހަމައެކަނި gridzyItem އަށް ވުރެ ގިނަ ސީއެސްއެސް ކްލާސްތަކެކެވެ . ގިނައީ އޮޓޮމެޓިކުން ސެޓް ކުރާނެ އެއްޗެހި ކަމަށާއި ސްޓައިލިން އަށް ވެސް ބޭނުން ކުރެވޭނެ އެއްޗެހި ކަމަށެވެ.
މައިގަނޑު ކޮންޓެއިނަރ ކްލާސްތައް
| ކްލާސް ނަން | ތަފްޞީލު |
|---|---|
gridzyމެނުއަލްކޮށް ސެޓް ކުރުމަށްޓަކައެވެ | ގްރިޑްޒީ އިން އޮޓޮމެޓިކުން މި ކްލާސް އާއި އެކު އެލިމެންޓްތައް ހޯދައި އެ އުފެއްދުންތައް އިނިޝިއަލައިޒް ކުރެއެވެ. |
gridzyAnimated | އޮޕްޝަން animate true ނަމަ އޮޓޮމެޓިކުން ސެޓް ކުރެވޭނެއެވެ . މި ކްލާސް މެނުއަލްކޮށް ސެޓްކޮށްފިނަމަ، animate އޮޕްޝަން ވެސް އޮޓޮމެޓިކުން true ވާނެ (އެއީ ސާފުކޮށް false އަށް ސެޓްކޮށްފައި އޮތްނަމަ ފިޔަވައި ). |
އައިޓަމް ކްލާސްތައް
| ކްލާސް ނަން | ތަފްޞީލު |
|---|---|
gridzyItem | އައިޓަމް އިނިޝިއަލައިޒް ކުރުމުގެ ޕްރޮސެސް ފެށުނުހާ އަވަހަކަށް ސެޓް ކުރެވޭނެއެވެ. ދުވަހަކުވެސް ނައްތާލެވޭކަށް ނެތެވެ. |
gridzyItemInitializing | އައިޓަމް އިނިޝިއަލައިޒް ކުރުމުގެ ޕްރޮސެސް ފެށުނުހާ އަވަހަކަށް ސެޓް ކުރެވޭނެއެވެ. އައިޓަމް ފުރިހަމައަށް އިނިޝިއަލައިޒް ކުރެވުނުހާ އަވަހަކަށް gridzyItemReady ގެ ބަދަލުގައި ބަދަލުކުރެވޭނެއެވެ. މާނައަކީ ތަސްވީރުތައް ފުރިހަމައަށް ލޯޑްވެފައިވާ ކަމަކަށް ނޫން ( gridzyItemLoading ބައްލަވާ)، އެކަމަކު އައިޓަމް ފެންނަން ތައްޔާރަށް ހުރުން. |
gridzyItemReady | އައިޓަމް ފުރިހަމައަށް އިނިޝިއަލައިޒް ކުރެވުނުހާ އަވަހަކަށް gridzyItemInitializing ބަދަލުކުރާނެއެވެ. ދުވަހަކުވެސް ނައްތާލެވޭކަށް ނެތެވެ. މާނައަކީ ތަސްވީރުތައް ފުރިހަމައަށް ލޯޑްވެފައި ހުރުމެއް ނޫން ( gridzyItemComplete ބައްލަވާ)، އެކަމަކު އައިޓަމް ފެންނަން ތައްޔާރަށް ހުރުން. |
gridzyItemLoading | އައިޓަމް އިނިޝިއަލައިޒް ކުރުމުގެ ޕްރޮސެސް ފެށުނުހާ އަވަހަކަށް ސެޓް ކުރެވޭނެއެވެ. ހިމެނޭ ތަސްވީރުތައް (އާންމުކޮށް އެންމެ އެއް ތަސްވީރު) ފުރިހަމައަށް ލޯޑް ކުރެވުނުހާ އަވަހަކަށް gridzyItemComplete ގެ ބަދަލުގައި ބަދަލުކުރެވޭނެއެވެ. |
gridzyItemComplete | އެކުލެވޭ ތަސްވީރުތައް (އާންމުކޮށް އެންމެ އެއް ތަސްވީރު) ފުރިހަމައަށް ލޯޑް ކުރެވުނުހާ އަވަހަކަށް gridzyItemLoading ބަދަލުގައި ބަދަލުވާނެއެވެ. ދުވަހަކުވެސް ނައްތާލެވޭކަށް ނެތެވެ. |
gridzyItemInitialToVisible | ފުރަތަމަ ފަހަރަށް އައިޓަމް ފެންނަން ފެށުމާއެކު ސެޓް ކުރެވޭނެއެވެ. އެ އެއްޗެއް މުޅިން ފެންނަހާ އަވަހަކަށް ނަގާނެއެވެ. |
gridzyItemVisible | އެ އެއްޗެއް ފުރިހަމައަށް ފެންނަހާ އަވަހަކަށް ސެޓް ކުރެވޭނެއެވެ. އެ އެއްޗެއް ނެތިގެން ދާން ފެށުމާއެކު ނަގާނެއެވެ. |
gridzyItemVisibleToHidden | އެ އެއްޗެއް ނެތިގެން ދާން ފެށުމާއެކު ސެޓް ކުރެވޭނެއެވެ. އެ އެއްޗެއް މުޅިން ފޮރުވިހާ އަވަހަކަށް ނަގާނެއެވެ. |
gridzyItemHidden | އެ އެއްޗެއް މުޅިން ފޮރުވިގެން ދިޔަހާ އަވަހަކަށް ސެޓް ކުރެވޭނެއެވެ. އެ އެއްޗެއް ފެންނަން ފެށުމާއެކު ނަގާނެއެވެ. |
gridzyItemHiddenToVisible | އައިޓަމް ފެންނަން ފެށުމާއެކު ސެޓް ކުރެވޭނެ (ފުރަތަމަ ފަހަރަށް ފެންނަން ފިޔަވައި – ކްލާސް gridzyItemInitialToVisible ބައްލަވާ ). އެ އެއްޗެއް މުޅިން ފެންނަހާ އަވަހަކަށް ނަގާނެއެވެ. |
gridzyItemVisibleToVisible | ގްރިޑްގައި އެއްޗެއް ބަދަލުވިހާ އަވަހަކަށް ސެޓް ކުރެވޭނެ ނަމަވެސް އެ އެއްޗެއް ޚުދު ވީ އަދި ފެންނަން ހުންނަނީ. ބަދަލު އެނިމޭޝަން ނިމުމާއެކު ނައްތާލެވޭނެއެވެ. |
ބައި ޑިފޯލްޓްކޮށް ޕްރޮސެސް އިންޑިކޭޓަރާއި ފެންނަ އަދި ގެއްލިގެންދާ ތަސްވީރުތަކުގެ އެނިމޭޝަންތައް ކުރިން ކަނޑައެޅިފައިވަނީ ގްރިޑްޒީ މައި ސީއެސްއެސް ފައިލް އިންނެވެ.
މިދެންނެވި ސީއެސްއެސް ކްލާސްތަކާއެކު އަމިއްލައަށް ޕްރޮސެސް އިންޑިކޭޓަރާއި އެނިމޭޝަންތައް ސްޓައިލް ކުރެވޭނެއެވެ. ގްރިޑްޒީ މައި ސީއެސްއެސް ފައިލް އަށް ބަލާލަން ކެރޭނެ، ތިބާ އޯވަރރައިޑް ކުރަން ޖެހޭނެ ކަންތައްތައް ވިސްނުމަށްޓަކައެވެ. ބިރެއް ނެތް، ހުރިހާ ކަމެއް އެތަނުގައި ރަނގަޅަށް ލިޔެކިޔުންތައް އެބަހުއްޓެވެ.
އޮޕްޓިމައިޒް ލޯޑިންގ
ގިނަ ތަސްވީރުތައް ބޭނުންކުރާނަމަ ގްރިޑްޒީއަށް ގްރިޑް އަވަހަށް ބިނާކުރުމުގައި އެހީތެރިވުމަކީ ރަނގަޅު ގޮތެކެވެ.
ޖަމްޕިންގ އިމޭޖްސް ހުއްޓުވުން
ގްރިޑްޒީ އަށް ގްރިޑް ހޯދުމަށް ހުރިހާ ތަސްވީރެއްގެ އެސްޕެކްޓް ރޭޝިއޯ ވަރަށް ބޮޑަށް ބޭނުންވެއެވެ. މި ހަގީގަތްތަކުގެ ނަތީޖާއަކަށް ވެގެންދަނީ ބައެއް ތަސްވީރުތައް ތައްޔާރުވެފައި އަނެއްބައި ތަސްވީރުތައް ތައްޔާރު ނުވާނަމަ އުނިއިތުރުތައް ފުންމާލުމެވެ. ތަސްވީރުތައް ގިނަވިވަރަކަށް މި އަސަރު ރުޅިގަދަވެދާނެ އެވެ.
މި ސުލޫކު ހުއްޓުވުމަށްޓަކައި، ހަމައެކަނި ހުރިހާ img އެލިމެންޓްތަކަށް width height އެޓްރިބިއުޓްސް ސެޓް ކުރާށެވެ. ކޮންމެ ވަކިވަކި ތަސްވީރަކަށް ރަނގަޅު އަގުތައް ސެޓްކުރުން މުހިންމު، އެހެން ނޫންނަމަ ތަސްވީރުތައް ޑިސްޓޯރޓް ވާނެއެވެ. ރަނގަޅު އަގުތަކަކީ އެކި ތަސްވީރުގެ އަސްލު ފުޅާމިނާއި އުސްމިނެވެ.
<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>އެއަށްފަހު ގްރިޑްޒީއަށް ވަގުތުން ގްރިޑް ކަލަންޑަރ ކުރެވޭނީ ތަސްވީރުތަކުގެ އަސްލު ސައިޒުތައް އެނގެން ނުޖެހިއެވެ.
ލޭޒީ ލޯޑިންގ
ހަމައެކަނި ފެންނަ ވިއުޕޯޓްގައި ހުންނަ ތަސްވީރުތައް ލޯޑް ކުރުމަށްޓަކައި، ހަމައެކަނި މި ފިޔަވަޅުތަކަށް އަމަލު ކުރައްވާށެވެ.
- މަތީގައި ބަޔާންކޮށްފައިވާ ގޮތަށް
widthheightއެޓްރިބިއުޓްސް އިންސަރޓްކުރުން (ރަނގަޅު އަގުތައް ބޭނުންކުރާކަން ޔަގީންކުރުން) - ތިރީގައިވާ ގޮތަށް ހުރިހާ
srcއެޓްރިބިއުޓްތަކެއްdata-gridzylazysrcއިން ބަދަލުކުރުން (srcsetއެޓްރިބިއުޓްތައް ވެސް ހުރިނަމަ،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>މި ފިޔަވަޅުތަކަށްފަހު ވިއުޕޯޓް ކައިރީގައި ނުވަތަ އެތެރޭގައި ހުރިހާ އަވަހަކަށް ތަސްވީރުތައް ލޯޑް ވާނެއެވެ.
ޕްރޮސެސް އިންޑިކޭޓަރ
ޕްރޮސެސް އިންޑިކޭޓަރަކީ ތަސްވީރު ލޯޑް ކުރާއިރު ފެންނަ ކުޑަ އެނިމޭޓެޑް އައިކޮން އެވެ. ކެޕްޝަންސް & ސްކިންސް ބޭނުން ކުރާނަމަ ޕްރޮސެސް އިންޑިކޭޓަރ އޮޓޮމެޓިކުން ފެންނާނެއެވެ. އެހެން ނޫންނަމަ ބައެއް އެޑްޖަސްޓްމަންޓްތައް ބޭނުންވެއެވެ:
- ކޮންމެ
imgއެލިމެންޓެއްdivއެލިމެންޓަކަށް ލާށެވެ
(ނުވަތަ އެހެން އެއްވެސް އުނިއިތުރެއްގެ ތެރެއަށް – އިތުރު މަޢުލޫމާތު ހޯދުމަށް ސެމެންޓިކް އެޗްޓީއެމްއެލް ބައްލަވާ) - ކޮންމެ
imgއެލިމެންޓަކަށް ކްލާސްgridzyImageއިތުރުކުރުން
<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>އެއަށްފަހު ތަސްވީރުތައް ލޯޑް ކުރަން ވަގުތު ނަގާނަމަ ޕްރޮސެސް އިންޑިކޭޓަރސް ފެންނަން ޖެހެއެވެ.
ފިލްޓަރސް
ގްރިޑްޒީގައި ހުންނަ ފިލްޓަރުތަކަކީ ކިތަންމެހާވެސް ސާދާ ނަމަވެސް ވަރުގަދަ ފިލްޓަރުތަކެކެވެ. ކޮންމެ ކަހަލަ ފިލްޓަރެއް ބޭނުންވިޔަސް، އެއީ ރިއަލައިޒޭބަލް އެއްޗެއް ކަމީ ވަރަށް ގާތް ކަމެކެވެ. ބޭނުންވަނީ، ތަންކޮޅެއް ސީއެސްއެސް އާއި މަދު އެޗްޓީއެމްއެލް ފޯމް އެލިމެންޓްތަކެއް ...
މިއީ ފަންކްޝަނަލް މިސާލެކެވެ.
<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>ލެޓްސް ބިލްޑް އިޓް ސްޓެޕް ބައި ސްޓެޕް
1. ފުރަތަމަ ބޭނުންވަނީ ގްރިޑްޒީގެ އާދައިގެ އެޗްޓީއެމްއެލް ސްޓްރަކްޗަރ އާއި ހުރިހާ ގެލެރީ އައިޓަމްތަކަށް ކްލާސް ނަންތައް ސެޓްކޮށްގެން އޭގެ ފަހުން ފިލްޓަރ ކުރެވޭނެއެވެ
<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>މި މިސާލުގައި އަޅުގަނޑުމެން ކޮންމެ އެލިމެންޓަކަށް ބޭނުންކުރަނީ އެންމެ ކްލާސްއެކެވެ. އެކަމަކު އެއް އެލިމެންޓަކަށް ގިނަ ކްލާސްތަކެއް ވެސް ސެޓް ކުރެވިދާނެ، އެ އެލިމެންޓް ގިނަ ފިލްޓަރުތަކެއް މެދުވެރިކޮށް ހޯދަން ޖެހޭނަމަ އެވެ.
2. ދެން އަޅުގަނޑުމެންނަށް ބައެއް ބަޓަންތައް އިތުރުކޮށް، އެ ބަޓަންތަކުގެ ތެރެއިން އަޅުގަނޑުމެންނަށް ދެން ފިލްޓަރުތައް ބަދަލުކުރެވޭނެ
<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>ބަޓަންތަކުގެ ބަދަލުގައި ޗެކްބޮކްސް، ރޭޑިއޯ ބަޓަން، ސެލެކްޓް ފީލްޑްސް ފަދަ އެހެން ފޯމް އެލިމެންޓްތައް ވެސް ބޭނުން ކުރެވިދާނެ އެވެ.
ފެންނަ ފެނުމުގައި ބަޓަންތަކުގެ އަގުތަކަކީ އާންމުކޮށް ސީއެސްއެސް ސެލެކްޓަރުތަކެކެވެ. އަޅުގަނޑުމެން ނިމުމާއެކު މިފަދަ ބަޓަނަކަށް ކްލިކް ކުރުމުން އެ ސީއެސްއެސް ސެލެކްޓަރާއި ގުޅޭ ތަސްވީރުތައް ފެންނާނެއެވެ. ޓެކްނިކަލީ އެއީ ފަސޭހައިން filter އޮޕްޝަން މި އަގަށް ސެޓް ކުރާ އެއްޗެކެވެ.
އަދި މިއަށްވުރެ މާ ކޮމްޕްލެކްސް ސެލެކްޓަރސް ބޭނުންކުރެވިދާނެއެވެ. މިސާލަކަށް :not(.animals) ވެސް މަސައްކަތް ކުރާނެ، ހަމައެހެންމެ .animals.people އަދި .animals, .people .
3. އެންމެ ފަހުން އަޅުގަނޑުމެން ބަޓަންތައް div ކޮންޓެއިނަރެއްގައި އެންކެޕްސުލޭޓްކޮށް، ގްރިޑްޒީ ގެލެރީއަށް ބައިންޑްކޮށް، 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>ފެންނަ ފެނުމުގައި އަޅުގަނޑުމެން filterControls އޮޕްޝަނަށް ސީއެސްއެސް ސެލެކްޓަރެއް ވެސް ބޭނުންކުރަމެވެ. id އެޓްރިބިއުޓް އެކުލެވޭ div ކޮންޓެއިނަރަކީ ހަމައެކަނި އެ ސީއެސްއެސް ސެލެކްޓަރ މެދުވެރިކޮށް ބަޓަންތައް ސެލެކްޓް ކުރުމަށް ފަސޭހަ ކުރުމަށް ޚިދުމަތް ކުރާ އެއްޗެކެވެ.
އެއީ!
ޖާވާސްކްރިޕްޓް ސޮލިއުޝަނަކަށް އިސްކަންދޭނަމަ، އެޕީއައި ބައްލަވާށެވެ.
އެޕީއައި އެވެ
ގްރިޑްޒީގެ އަމިއްލަ އެޕީއައިއެއް އޮތް ނަމަވެސް، ގިނަ ކަންތައްތައް ކުރެވޭނީ އެއާ ނުލައި، ހަމައެކަނި ޑީއޯއެމް މެނިޕުލޭޓް ކޮށްގެންނެވެ. ގްރިޑްޒީއަށް އެކަން ފާހަގަވެ ގްރިޑް އެޖެސްޓް ކުރާނެއެވެ. އެކަމަކު ވަރަށް ވަރުގަދަ އެޕީއައި އެއް ވެސް އެބަހުރި ...
ޑީއޯއެމް މެނިޕުލޭޓް ކުރުން
ހުރިހާ ޑޮކިއުމެންޓް އޮބްޖެކްޓް މޮޑެލް (ޑީއޯއެމް) މެނިޕިއުލޭޝަންތަކަށް އަޅުގަނޑުމެންނަށް ފުރަތަމަ ބޭނުންވަނީ ކޮންޓެއިނަރ އެލިމެންޓް:
// get the container element
var gridzyElement = document.querySelector('.gridzy');އިމޭޖްސް އެޑްކުރުން
ކޮންޓެއިނަރ އެލިމެންޓަށް އިތުރު ކުރުމުގެ ކުރިން އާ ޗައިލްޑް އެލިމެންޓް ފުރިހަމައަށް ބިނާކޮށް ފުރިހަމަ ކުރުން މުހިންމެވެ. އެހެން ނޫންނަމަ ގްރިޑްޒީއަށް ރަނގަޅު ޑިމައިންސްތައް ފާހަގަ ނުކުރެވޭނެއެވެ.
// 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);އިމޭޖްތައް ނައްތާލާށެވެ
// remove the first image
gridzyElement.removeChild(gridzyElement.firstElementChild);އޮޕްޝަންސް ބަދަލުކުރުން
// 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');ޑީއޯއެމް މެނިޕުލޭޓް ކުރުމާ ބެހޭ އިތުރު މައުލޫމާތު އެމްޑީއެން ވެބް ޑޮކްސް އިން ލިބެން ހުންނާނެއެވެ . އަދި އިންޓްރޮޑަކްޝަން ޓު ދަ ޑީއޯއެމް ވެސް ލިބެން ހުރެއެވެ.
ޕްރޮޕްރިއޭޓަރީ އެޕީއައި އެވެ
އެޕީއައި ބޭނުން ކުރުމަށްޓަކައި، އަޅުގަނޑުމެންނަށް ފުރަތަމަ ބޭނުންވަނީ ގްރިޑްޒީ އިންސްޓޭންސް، މިއީ ގްރިޑްޒީ ކޮންޓެއިނަރ އެލިމެންޓަށް ބައިންޑް ކުރެވިފައިވާ އެއްޗެކެވެ:
// get the Gridzy instance
var gridzyInstance = document.querySelector('.gridzy').gridzy;އޮޕްޝަން ހޯއްދަވާށެވެ
// get the value of a single option
var currentLayout = gridzyInstance.getOption('layout');ހުރިހާ އޮޕްޝަންތަކެއް ހޯއްދަވާށެވެ
// get all option values as an object
var currentOptions = gridzyInstance.getOptions();އޮޕްޝަންސް ސެޓްކުރުން
// set specific option values
gridzyInstance.setOptions({
spaceBetween: 10,
layout: 'waterfall'
});
// or reset options to their default values
gridzyInstance.setOptions({
spaceBetween: null,
layout: null
});ފިލްޓަރ އެޕްލައި ކުރާށެވެ
ފިލްޓަރެއް އެޕްލައި ކުރުމަކީ ހަމައެކަނި ކޮންމެ ސައްހަ ސީއެސްއެސް ސެލެކްޓަރަކަށް ވެދާނެ އޮޕްޝަން filter ސެޓް ކުރުމެވެ:
// 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'
});ކޯލްބެކް ފަންކްޝަންސް އިތުރުކުރުން
ވަރޝަން 2.4.0 އިން ފެށިގެން މުއްދަތު ހަމަނުވާ
އޭގެ ބަދަލުގައި ޒަމާނީ އަދި މާ ފްލެކްސިބަލް އިވެންޓްތައް ބޭނުން ކުރާށެވެ. ތަފްސީލު ހޯދުމަށް ދެން އޮތް ބައި ބައްލަވާށެވެ.
Gridzy.js 2 އިން ކޯލްބެކް ފަންކްޝަންތަކަށް ބައެއް އޮޕްޝަންތަކަށް ސަޕޯޓްކުރެއެވެ. އެއީ ހަމައެކަނި ޕްރޮޕްރިއޭޓަރީ އެޕީއައި މެދުވެރިކޮށް ސެޓް ކުރެވޭ އެއްޗެހި ނަމަވެސް އެހެން އޮޕްޝަންތަކެކޭ އެއްފަދައިން:
// 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.
}
});އިވެންޓްސް ބޭނުންކުރުން
ވަރޝަން 2.4.0 އިން ފެށިގެންނެވެ
އާންމުކޮށް ޖާވާސްކްރިޕްޓް އިވެންޓްތަކާ އެއްގޮތަށް ގްރިޑްޒީ އިވެންޓްތައް ބޭނުންކުރެވިދާނެއެވެ:
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.
});ބައެއް އިވެންޓްތައް ގްރިޑްޒީ ކޮންޓެއިނަރ އެލިމެންޓްގައި ފަޔަރ ކުރާއިރު އަނެއްބައި އިވެންޓްތައް ފަޔަރ ކުރެވެނީ ކޮންޓެއިނަރ އެލިމެންޓްގެ ތެރޭގައި ހުންނަ ވަކިވަކި އައިޓަމް އެލިމެންޓްތަކަށެވެ.
ގްރިޑްޒީ ކޮންޓެއިނަރ އެލިމެންޓަށް ފަޔަރ ކުރި އިވެންޓްތައް:
event.target ގްރިޑްޒީ ކޮންޓެއިނަރ އެލިމެންޓް ފޯރުކޮށްދެއެވެ.
event.detail.instance ގްރިޑްޒީ އިންސްޓޭންސް ފޯރުކޮށްދެއެވެ.
އައިޓަމް އެލިމެންޓްތަކުގެ މައްޗަށް ފަޔަރ ކުރި އިވެންޓްތައް:
event.target އެކި އައިޓަމް އެލިމެންޓް ފޯރުކޮށްދެއެވެ.
event.detail.instance ގްރިޑްޒީ އިންސްޓޭންސް ފޯރުކޮށްދެއެވެ.
އެޕީއައި – ގްލޯބަލް
ގްރިޑްޒީ އިންސްޓޭންސްތަކުން މިނިވަން ބައެއް ފަންކްޝަންތައް ހުރެއެވެ. އެހެންވީމާ އަޅުގަނޑުމެންނަށް ކުރިން އިންސްޓޭންސެއް ހޯދަން ނުޖެހޭ.
ޑިފޯލްޓް އޮޕްޝަން ހޯދުން
// get the default value of a single option
var defaultLayout = Gridzy.getDefaultOption('layout');ހުރިހާ ޑިފޯލްޓް އޮޕްޝަންސް ހޯދުން
// 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');ޑިފޯލްޓް އޮޕްޝަންސް ސެޓްކުރުން
މިއީ މިހާރުވެސް އިނިޝިއަލައިޒް ކުރެވިފައިވާ ހުރިހާ ގްރިޑްޒީ އިންސްޓޭންސްތަކެއްގެ އޮޕްޝަންތައް ސެޓް ނުކުރާ ނަމަވެސް އާ އިންސްޓޭންސްތަކުގެ އަސާސް ކަނޑައަޅާ ކަމެކެވެ. ނަމަވެސް މިހާރު ހުރި އިންސްޓޭންސްއެއްގެ އޮޕްޝަނެއް ވެލިއު null މެދުވެރިކޮށް ރީސެޓް ކުރެވޭނަމަ، އެއީ އާ ޑިފޯލްޓް ވެލިއު ބޭނުންކުރާނެ އެއްޗެކެވެ.
// set default option values
Gridzy.setDefaultOptions({
spaceBetween: 10,
layout: 'waterfall'
});މިއީ ޑީއޯއެމް ތައްޔާރުވުމުގެ ކުރިން ގުޅާނަމަ، ގްލޯބަލްކޮށް އޮޕްޝަންތައް ސެޓްކުރުމަށް ބޭނުންކުރެވިދާނެއެވެ. އެހެންކަމުން ދެން އޮޕްޝަންތައް އެޓްރިބިއުޓްގެ ގޮތުގައި ސެޓް ކުރަން ނުޖެހޭނެއެވެ.
އޮޓޮމެޓިޒަމްސް އެވެ
Gridzy.js 2 ގެ ހުރިހާ އޮޓޮމެޓިޒަމްސް އެއް އެކްޓިވް ވާހާ ހިނދަކު ތިރީގައިވާ ގޮތްތަކުގެ ބޭނުމެއް ނެތެވެ. އެކަމަކު ގްރިޑްޒީ ބޭނުން ކުރުމަށް އޮޓޮމެޓިޒަމްތައް ނިއްވާލެވިދާނެ އެވެ:
// 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
});މިއިން ބައެއް އިޚްތިޔާރުތައް data-gridzy- އެޓްރިބިއުޓްސް މެދުވެރިކޮށް ނުވަތަ setOptions() މެދުވެރިކޮށް ސެޓް ނުކުރެވޭ، ލޮޖިކަލް ސަބަބުތަކާހުރެ:
މެނުއަލްކޮށް އިނިޝިއަލައިޒް ކުރުން
// initialize a new Gridzy instance
var gridzyInstance = new Gridzy(document.querySelector('.gridzy'), {
spaceBetween: 10,
layout: 'waterfall'
});އިންސްޓޭންސް ނައްތާލާށެވެ
ގާތްގަނޑަކަށް ބުނާނަމަ، ގްރިޑްޒީ އިނިޝިއަލައިޒް ކުރުމާ އިދިކޮޅެވެ.
gridzyInstance.destroy();
gridzyInstance = null;ޗައިލްޑް ލިސްޓް މެނުއަލްކޮށް ސިންކް ކުރުން
// after child elements (images) are added to or removed from the DOM.
gridzyInstance.syncChildList();ސިންގަލް ޗައިލްޑް އެލިމެންޓެއް މެނުއަލްކޮށް ސިންކް ކުރުން
އާންމުކޮށް ބޭނުން ނުވާ، ވަރަށް މަދު ހާލަތްތަކުގައި ފިޔަވައި.
// after child elements (images) are added to the DOM and only one of them should be synced to Gridzy.
gridzyInstance.syncChild(childElement);އެޓްރިބިއުޓްސް މެނުއަލްކޮށް ސިންކް ކުރުން
މިކަމަށް useOptionAttributes އޮޕްޝަން true ޖެހޭނެކަން ފާހަގަކޮށްލެވެއެވެ.
// after data-gridzy- attributes have changed
gridzyInstance.syncAttributes();ފޯސް ރެންޑަރިންގ
އާންމުކޮށް ބޭނުން ނުވާ، ހުރިހާ އޮޓޮމެޓިޒަމްތަކެއް ނިއްވާލާފައި ހުއްޓަސް
gridzyInstance.render();