ୱେବସାଇଟ୍ ସ୍ୱୟଂଚାଳିତ ଭାବରେ ଅନୁବାଦ କରାଯାଇଛି | ଯଦି କିଛି ସ୍ପଷ୍ଟ ନୁହେଁ, ଦୟାକରି ଇଂରାଜୀ ଡକ୍ୟୁମେଣ୍ଟେସନ୍ କୁ ଦେଖନ୍ତୁ |
ମ Basic ଳିକ ବ୍ୟବହାର
ଗ୍ରୀଡି ଫାଇଲଗୁଡ଼ିକୁ ଆପଣଙ୍କର ସର୍ଭରରେ ଅପଲୋଡ୍ କରନ୍ତୁ ଏବଂ ସେଗୁଡିକୁ ଆପଣଙ୍କର ୱେବସାଇଟ୍ ରେ ଯୋଡନ୍ତୁ (ସାଧାରଣତ the ହେଡ୍ ବିଭାଗରେ):
<link rel="stylesheet" href="gridzy/gridzy.min.css" />
<script src="gridzy/gridzy.min.js"></script>HTML କୋଡ୍ ଯୋଡନ୍ତୁ (ଶରୀର ବିଭାଗର ଯେକ anywhere ଣସି ସ୍ଥାନରେ):
<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>ତାହା ହେଉଛି! ତାହା ଏକ ସମ୍ପୂର୍ଣ୍ଣ କାର୍ଯ୍ୟକ୍ଷମ ଉଦାହରଣ | କ extra ଣସି ଅତିରିକ୍ତ ପ୍ରାରମ୍ଭିକରଣ ଆବଶ୍ୟକ ନାହିଁ |
ବିନ୍ୟାସ
ଗ୍ରୀଡି ବିନ୍ୟାସ କରିବାର ସହଜ ଉପାୟ ହେଉଛି, କେବଳ HTML ଗୁଣ ବ୍ୟବହାର କରିବା | ଆପଣଙ୍କୁ କେବଳ 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 ଲେଆଉଟ୍ ବିକଳ୍ପଗୁଡ଼ିକ |
ଅଧିକ ଉନ୍ନତ ବିକଳ୍ପ |
ଅଧିକ ଉନ୍ନତ ବିକଳ୍ପ ପାଇଁ, API ଯାଞ୍ଚ କରନ୍ତୁ |
ଅର୍ଥଗତ HTML |
ଗ୍ରିଜ୍ ର ସରଳ HTML ଗଠନ ହେଉଛି:
<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>ଯଦିଓ, ଗ୍ରୀଡି ବହୁତ ନମନୀୟ ଏବଂ ଆପଣ ପ୍ରାୟ ଅନ୍ୟ HTML ସଂରଚନା ବ୍ୟବହାର କରିପାରିବେ | ବିଚାର କରିବାକୁ କେବଳ କିଛି ବିନ୍ଦୁ ଅଛି:
- କଣ୍ଟେନର ଉପାଦାନର ପ୍ରତ୍ୟେକ ପିଲା ଗ୍ରୀଡରେ ଗୋଟିଏ ଆଇଟମ୍ ପ୍ରତିନିଧିତ୍ୱ କରନ୍ତି |
- ଉଭୟ କଣ୍ଟେନର ଉପାଦାନ ଏବଂ ଏହାର ପିଲାମାନେ ଯେକ tag ଣସି ଟ୍ୟାଗ୍ ପ୍ରକାର ହୋଇପାରନ୍ତି, ଯେପରିକି
ulଏବଂli(କେବଳ ବ୍ରାଉଜର୍ ଡିଫଲ୍ଟ ପୁନ res ସେଟ୍ କରିବାକୁ ବିଚାର କରନ୍ତୁ) | - ଯଦି ଏକ
imgଉପାଦାନ ନିଜେ ଏକ ସିଧାସଳଖ ପିଲା ନୁହେଁ, ତେବେ ଏହା କ୍ଲାସ୍gridzyImageଆବଶ୍ୟକ କରେ |
ତେଣୁ ଏହା ମଧ୍ୟ ଏକ କାର୍ଯ୍ୟ କରୁଥିବା HTML ସଂରଚନା:
<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>ବିଶେଷକରି ଯଦି ଆପଣ କ୍ୟାପ୍ସନ୍ ଯୋଡିବାକୁ ଚାହାଁନ୍ତି, ତେବେ ଆପଣଙ୍କୁ ଏକ ଉନ୍ନତ HTML ଗଠନ ଆବଶ୍ୟକ | ଏହା ବିଷୟରେ ଅଧିକ ଜାଣିବାକୁ, କ୍ୟାପସନ୍ ଏବଂ ସ୍କିନ୍ସ ଉପରେ ନଜର ପକାନ୍ତୁ |
କ୍ୟାପସନ୍ ଏବଂ ଚର୍ମ |
ଯଦି ତୁମେ ତୁମର ଗ୍ୟାଲେରୀରେ କ୍ୟାପସନ୍ ଯୋଡିବାକୁ ଚାହୁଁଛ, ତୁମକୁ ରୂପକୁ ବ୍ୟାଖ୍ୟା କରିବାକୁ ପଡିବ | ତେଣୁ, କିଛି ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ ଚର୍ମ ଉପଲବ୍ଧ | ପ୍ରତ୍ୟେକ ଚର୍ମ ଏକ CSS ଫାଇଲକୁ ନେଇ ଗଠିତ | ମୂଖ୍ୟ ଗ୍ରୀଡି ଫାଇଲଗୁଡ଼ିକ ସହିତ ଆପଣଙ୍କୁ ଏହି ଫାଇଲ୍ ଯୋଡିବାକୁ ପଡିବ (ସାଧାରଣତ the ହେଡ୍ ବିଭାଗରେ):
<link rel="stylesheet" href="gridzy/skins/gridzySkinClassic/style.min.css" />ଅଧିକନ୍ତୁ, ଆପଣ ଏକ ଉନ୍ନତ 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>ଯଦି ଆପଣ HTML ଗଠନ ବିଷୟରେ ଚିନ୍ତା କରୁଛନ୍ତି, ସେମାଣ୍ଟିକ୍ HTML କୁ ଦେଖନ୍ତୁ |
କ୍ୟାପସନ୍ ପାଇଁ ଆପଣ ଯେକ type ଣସି ପ୍ରକାରର ଟ୍ୟାଗ୍ ବ୍ୟବହାର କରିପାରିବେ, ନିଶ୍ଚିତ କରନ୍ତୁ ଯେ ଏଥିରେ କ୍ଲାସ୍ gridzyCaption ଅଛି | img ଉପାଦାନ ଶ୍ରେଣୀ gridzyImage ଆବଶ୍ୟକ କରେ |
ଉପରୋକ୍ତ ଉଦାହରଣ ଆପଣଙ୍କୁ ଚର୍ମ gridzySkinClassic ଦେଖାଏ | ଏକ ଭିନ୍ନ ବ୍ୟବହାର କରିବାକୁ, କେବଳ ଚର୍ମ ନାମକୁ ଏଥି ମଧ୍ୟରୁ ଗୋଟିଏ ସହିତ ବଦଳାନ୍ତୁ:
ଚର୍ମ ଅନ୍ତର୍ଭୁକ୍ତ |
| ଉପଲବ୍ଧ ଶ୍ରେଣୀଗୁଡିକ | |
|---|---|
| gridzySkinBlank ଏକ ଚର୍ମ ସୃଷ୍ଟି ପାଇଁ ଏକ ଭଲ ଆରମ୍ଭ | ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinBlank |
| gridzySkinClassic ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinClassic(ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ DEPRECATED) |
| gridzySkinFullOverlay ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinFullOverlay(ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ DEPRECATED) |
| gridzySkinLift ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinLift(ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ DEPRECATED) |
| gridzySkinMagnifier ଜୁମ୍ କାର୍ଯ୍ୟକାରିତା ଅନ୍ତର୍ଭୂକ୍ତ ନୁହେଁ | ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinMagnifier(ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ DEPRECATED) |
ଉପରୋକ୍ତ ସମସ୍ତ ଚର୍ମଗୁଡିକ କେବଳ ଏକ CSS ଫାଇଲ୍ ଆବଶ୍ୟକ କରେ, କିନ୍ତୁ ସେଠାରେ ଅତିରିକ୍ତ ଚର୍ମ ଅଛି ଯାହାକି ଏକ ଜାଭାସ୍କ୍ରିପ୍ଟ ଫାଇଲ୍ ମଧ୍ୟ ଆବଶ୍ୟକ କରେ:
<link rel="stylesheet" href="gridzy/skins/gridzySkinBlur/style.min.css" />
<script src="gridzy/skins/gridzySkinBlur/script.min.js"></script>| ଉପଲବ୍ଧ ଶ୍ରେଣୀଗୁଡିକ | |
|---|---|
| gridzySkinBlur IE ରେ କାମ କରେ ନାହିଁ ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinBlur(ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ DEPRECATED) |
| gridzySkinCard ଲାଇଭ୍ ପୂର୍ବାବଲୋକନ | | gridzySkinCard(ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ DEPRECATED) |
ଚର୍ମ ବିକଳ୍ପ |
ସଂସ୍କରଣ 2.6.0 ପରଠାରୁ ବିଲ୍ଟ-ଇନ୍ ସ୍କିନ୍ ବିନ୍ୟାସ କରିବାକୁ ବିକଳ୍ପ ଅଛି | ନିର୍ଦ୍ଦିଷ୍ଟ ଚର୍ମ ଉପରେ ନିର୍ଭର କରି ଆପଣ ପୃଷ୍ଠଭୂମି ରଙ୍ଗ, ପାଠ୍ୟ ରଙ୍ଗ ଏବଂ ପାଠ୍ୟ ଛାୟା ସେଟ୍ କରିପାରିବେ | ଆପଣଙ୍କୁ କେବଳ CSS କଷ୍ଟମ୍ ଗୁଣ ବ୍ୟବହାର କରିବାକୁ ପଡିବ ଯେପରି ଆପଣ ଏଠାରେ ଦେଖିପାରିବେ:
<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) | ଯେକ any ଣସି CSS ପୃଷ୍ଠଭୂମି ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--color | rgb(255, 255, 255) | ଯେକ any ଣସି CSS ରଙ୍ଗ ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--text-shadow | none | ଯେକ any ଣସି CSS ପାଠ୍ୟ-ଛାୟା ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
gridzySkinFullOverlay
| ଭେରିଏବଲ୍ | ଡିଫଲ୍ଟ ମୂଲ୍ୟ | ସୂଚନା |
|---|---|---|
--background | rgba(0, 0, 0, .7) | ଯେକ any ଣସି CSS ପୃଷ୍ଠଭୂମି ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--color | rgb(255, 255, 255) | ଯେକ any ଣସି CSS ରଙ୍ଗ ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--text-shadow | none | ଯେକ any ଣସି CSS ପାଠ୍ୟ-ଛାୟା ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
gridzySkinLift
| ଭେରିଏବଲ୍ | ଡିଫଲ୍ଟ ମୂଲ୍ୟ | ସୂଚନା |
|---|---|---|
--background | rgba(0, 0, 0, .7) | ଯେକ any ଣସି CSS ପୃଷ୍ଠଭୂମି ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--color | rgb(255, 255, 255) | ଯେକ any ଣସି CSS ରଙ୍ଗ ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--text-shadow | 0 0 10px rgb(0, 0, 0), 0 0 20px rgb(0, 0, 0), 0 0 30px rgb(0, 0, 0) | ଯେକ any ଣସି CSS ପାଠ୍ୟ-ଛାୟା ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
gridzySkinMagnifier
| ଭେରିଏବଲ୍ | ଡିଫଲ୍ଟ ମୂଲ୍ୟ | ସୂଚନା |
|---|---|---|
--background | rgba(0, 0, 0, .7) | ଯେକ any ଣସି CSS ପୃଷ୍ଠଭୂମି ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--color | rgb(255, 255, 255) | ଯେକ any ଣସି CSS ରଙ୍ଗ ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
ଏହି ଚର୍ମ --text-shadow ସମର୍ଥନ କରେନାହିଁ |
gridzySkinBlur
| ଭେରିଏବଲ୍ | ଡିଫଲ୍ଟ ମୂଲ୍ୟ | ସୂଚନା |
|---|---|---|
--background | rgba(0, 0, 0, .7) | ଯେକ any ଣସି CSS ପୃଷ୍ଠଭୂମି ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--color | rgb(255, 255, 255) | ଯେକ any ଣସି CSS ରଙ୍ଗ ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--text-shadow | 0 0 10px rgb(0, 0, 0) | ଯେକ any ଣସି CSS ପାଠ୍ୟ-ଛାୟା ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
gridzySkinCard
| ଭେରିଏବଲ୍ | ଡିଫଲ୍ଟ ମୂଲ୍ୟ | ସୂଚନା |
|---|---|---|
--background | rgba(0, 0, 0, 1) | ଯେକ any ଣସି CSS ପୃଷ୍ଠଭୂମି ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--color | rgb(255, 255, 255) | ଯେକ any ଣସି CSS ରଙ୍ଗ ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
--text-shadow | none | ଯେକ any ଣସି CSS ପାଠ୍ୟ-ଛାୟା ମୂଲ୍ୟକୁ ଅନୁମତି ଦିଏ | |
ସମସ୍ତ ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ ଚର୍ମଗୁଡିକ କେବଳ ସରଳ ପାଠ୍ୟ କ୍ୟାପସନ୍ କୁ ସମର୍ଥନ କରେ | ଆପଣ ନିଜର ଏବଂ ଅଧିକ ଜଟିଳ ଚର୍ମ ସୃଷ୍ଟି କରିପାରିବେ | ଦୟାକରି ଷ୍ଟାଇଲ୍ ଗ୍ରୀଡି ଉପରେ ନଜର ପକାନ୍ତୁ |
ଷ୍ଟାଇଲ୍ ଗ୍ରୀଜ୍
ଯଦି କ pred ଣସି ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ ଚର୍ମ ଆପଣଙ୍କ ଆବଶ୍ୟକତା ସହିତ ମେଳ ଖାଉ ନାହିଁ, ତେବେ ଆପଣ ନିଜସ୍ୱ ଶ style ଳୀ କରିପାରିବେ |
ସବୁଠାରୁ ସହଜ ଉପାୟ ହେଉଛି ପ୍ରଥମେ ଏକ ବିଦ୍ୟମାନ ଚର୍ମକୁ କପି କରିବା ଏବଂ ଏହାକୁ ନିଜ ଆବଶ୍ୟକତା ସହିତ ଖାପ ଖାଇବା | ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ ଚର୍ମ gridzySkinBlank ସାଧାରଣତ a ଏକ ଭଲ ଭିତ୍ତିଭୂମି ପ୍ରଦାନ କରିବା ସହିତ 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;
}CSS ଫାଇଲ୍ ରେ ଆପଣ କ୍ଲାସ୍ gridzySkinBlank , gridzyImage ଏବଂ gridzyCaption ପାଇପାରିବେ | ଗ୍ରୀଡି ନିଜେ ଏହି ଶ୍ରେଣୀର ଆବଶ୍ୟକ କରନ୍ତି ନାହିଁ | ସେଗୁଡିକ କେବଳ ଷ୍ଟାଇଲିଂ ପାଇଁ ବ୍ୟବହୃତ ହୁଏ ଏବଂ ତେଣୁ ଆପଣ ଚାହିଁଲେ ସେଗୁଡିକୁ ଅପସାରଣ କିମ୍ବା ନାମ ପରିବର୍ତ୍ତନ କରିପାରିବେ |
ଅତିରିକ୍ତ ଭାବରେ, ଆପଣ CSS ଶ୍ରେଣୀ gridzyItem ପାଇବେ | ଗ୍ରୀଡିଜି ଏହି ଶ୍ରେଣୀକୁ ସ୍ୱୟଂଚାଳିତ ଭାବରେ ମୁଖ୍ୟ କଣ୍ଟେନର ଉପାଦାନର ସମସ୍ତ ପ୍ରତ୍ୟକ୍ଷ ପିଲାମାନଙ୍କ ପାଇଁ ସେଟ୍ କରେ | ତେଣୁ, ତୁମେ ତୁମର ଗ୍ୟାଲେରୀର ଆଇଟମଗୁଡିକ ଶ style ଳୀ କରିବାକୁ ଏହି ଶ୍ରେଣୀକୁ ବ୍ୟବହାର କରିପାରିବ |
ଗୁରୁତ୍ୱପୂର୍ଣ୍ଣ ଜିନିଷଗୁଡ଼ିକୁ ମନ ଦିଅ |
- ଆଇଟମ୍ ବିଷୟବସ୍ତୁଗୁଡ଼ିକ ସମ୍ପୂର୍ଣ୍ଣ ପ୍ରତିକ୍ରିୟାଶୀଳ ହେବା ଉଚିତ୍ | ଧ୍ୟାନ ଦିଅନ୍ତୁ ଯେ ଉପାଦାନ ଆକାର ନିଶ୍ଚିତ ଭାବରେ ପରିବର୍ତ୍ତନ ହେବ | ପିକ୍ସେଲ ମୂଲ୍ୟ ବଦଳରେ ଶତକଡା ମୂଲ୍ୟ ବ୍ୟବହାର କରନ୍ତୁ | ଏବଂ ଗ୍ରୀଜ୍ ଲେଆଉଟ୍ ଅପ୍ସନ୍
autoFontSizeଉପରେ ନଜର ପକାନ୍ତୁ, ଯାହା ଫଣ୍ଟ୍ ସାଇଜ୍ ଆଇଟମ୍ ବକ୍ସ ସାଇଜ୍ ଉପରେ ବାନ୍ଧେ | - ପ୍ରତ୍ୟେକ ଆଇଟମ୍ ର ଏକ ସୁ-ପରିଭାଷିତ ଅନୁପାତ ରହିବା ଉଚିତ | ଆଇଟମ୍ ର ଆସପେକ୍ଟ ଅନୁପାତ କଦାପି ପରିବର୍ତ୍ତନ ହେବ ନାହିଁ ଏବଂ ଗ୍ରୀଡ୍ ଗଣନା କରିବା ପାଇଁ ଆବଶ୍ୟକ | ତେଣୁ ଯଦି କ item ଣସି ଆଇଟମ୍ ସ୍ୱୟଂଚାଳିତ ଭାବରେ ଏକ ସୁ-ପରିଭାଷିତ ଦିଗ ଅନୁପାତ ନଥାଏ, ତେବେ ଏହାକୁ ମାନୁଆଲ ଭାବରେ ସ୍ଥିର କରନ୍ତୁ (ଯଥା css ମାଧ୍ୟମରେ) |
କେତେକ କ୍ଷେତ୍ରରେ, ଗ୍ରୀଡି ଆରମ୍ଭ ହେବା ପୂର୍ବରୁ ଆଇଟମଗୁଡିକର ବିଷୟବସ୍ତୁ ଶ style ଳୀ କରିବା ସହଜ ହୋଇପାରେ | ଏଥିପାଇଁ ଅସ୍ଥାୟୀ ଭାବରେ କ୍ଲାସ୍ gridzy କିମ୍ବା ଗ୍ରୀଡି ଜାଭାସ୍କ୍ରିପ୍ଟ ଫାଇଲ୍ ଅପସାରଣ କରନ୍ତୁ |
ତାହା ହେଉଛି! ତୁମର ଚର୍ମ ତିଆରି କରିବା ପାଇଁ ତାହା ହିଁ ଦରକାର | ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ ଚର୍ମଗୁଡିକ ଏହା ଅଧିକ ବ୍ୟବହାର କରେ ନାହିଁ |
କିନ୍ତୁ ଆପଣ ଚାହିଁଲେ ଅଧିକ ହୋଇପାରେ…
ଉନ୍ନତ ଚର୍ମ |
ଗ୍ରୀଜ୍ କେବଳ gridzyItem ଅପେକ୍ଷା ଅଧିକ CSS କ୍ଲାସ୍ ବ୍ୟବହାର କରେ | ସେମାନଙ୍କ ମଧ୍ୟରୁ ଅଧିକାଂଶ ସ୍ୱୟଂଚାଳିତ ଭାବରେ ସେଟ୍ ହୋଇଯିବ ଏବଂ ଆପଣ ଏହାକୁ ଷ୍ଟାଇଲ୍ ପାଇଁ ମଧ୍ୟ ବ୍ୟବହାର କରିପାରିବେ |
ମୁଖ୍ୟ ଧାରଣକାରୀ ଶ୍ରେଣୀଗୁଡିକ |
| ଶ୍ରେଣୀ ନାମ | ବର୍ଣ୍ଣନା |
|---|---|
gridzyମାନୁଆଲ୍ ସେଟ୍ କରିବାକୁ | | ଗ୍ରୀଡି ସ୍ୱୟଂଚାଳିତ ଭାବରେ ଏହି ଶ୍ରେଣୀ ସହିତ ଉପାଦାନଗୁଡିକ ଖୋଜି ବାହାର କରେ | |
gridzyAnimated | ଯଦି ବିକଳ୍ପ animate true ହୁଏ ତେବେ ସ୍ୱୟଂଚାଳିତ ଭାବରେ ସେଟ୍ ହେବ | ଯଦି ଏହି ଶ୍ରେଣୀଟି ହସ୍ତକୃତ ଭାବରେ ସେଟ୍ ହୋଇଛି, animate ବିକଳ୍ପ ସ୍ୱୟଂଚାଳିତ ଭାବରେ ମଧ୍ୟ true ହୋଇଯିବ (ଯଦି ଏହା ସ୍ପଷ୍ଟ ଭାବରେ false ସେଟ୍ ହୋଇଛି) | |
ଆଇଟମ୍ କ୍ଲାସ୍ |
| ଶ୍ରେଣୀ ନାମ | ବର୍ଣ୍ଣନା |
|---|---|
gridzyItem | ଆଇଟମ୍ ପ୍ରାରମ୍ଭିକ ପ୍ରକ୍ରିୟା ଆରମ୍ଭ କରିବା ମାତ୍ରେ ସେଟ୍ ହେବ | କଦାପି ଅପସାରିତ ହେବ ନାହିଁ | |
gridzyItemInitializing | ଆଇଟମ୍ ପ୍ରାରମ୍ଭିକ ପ୍ରକ୍ରିୟା ଆରମ୍ଭ କରିବା ମାତ୍ରେ ସେଟ୍ ହେବ | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ପ୍ରାରମ୍ଭ ହେବା ମାତ୍ରେ gridzyItemReady ଦ୍ୱାରା ବଦଳାଯିବ | ଏହାର ଅର୍ଥ ନୁହେଁ ଯେ ପ୍ରତିଛବିଗୁଡ଼ିକ ସମ୍ପୂର୍ଣ୍ଣ ଭାବରେ ଲୋଡ୍ ହୋଇଛି ( gridzyItemLoading ଦେଖନ୍ତୁ), କିନ୍ତୁ ଆଇଟମ୍ ଦୃଶ୍ୟମାନ ହେବାକୁ ପ୍ରସ୍ତୁତ | |
gridzyItemReady | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ପ୍ରାରମ୍ଭ ହେବା ମାତ୍ରେ gridzyItemInitializing ବଦଳାଇବ | କଦାପି ଅପସାରିତ ହେବ ନାହିଁ | ଏହାର ଅର୍ଥ ନୁହେଁ ଯେ ପ୍ରତିଛବିଗୁଡ଼ିକ ସମ୍ପୂର୍ଣ୍ଣ ଭାବରେ ଲୋଡ୍ ହୋଇଛି ( gridzyItemComplete ଦେଖନ୍ତୁ), କିନ୍ତୁ ଆଇଟମ୍ ଦୃଶ୍ୟମାନ ହେବାକୁ ପ୍ରସ୍ତୁତ | |
gridzyItemLoading | ଆଇଟମ୍ ପ୍ରାରମ୍ଭିକ ପ୍ରକ୍ରିୟା ଆରମ୍ଭ କରିବା ମାତ୍ରେ ସେଟ୍ ହେବ | ଧାରଣ କରିଥିବା ପ୍ରତିଛବିଗୁଡିକ (ସାଧାରଣତ only କେବଳ ଗୋଟିଏ) ସମ୍ପୂର୍ଣ୍ଣ ଭାବରେ ଲୋଡ୍ ହେବା ମାତ୍ରେ gridzyItemComplete ଦ୍ୱାରା ବଦଳାଯିବ | |
gridzyItemComplete | ଧାରଣ କରିଥିବା ପ୍ରତିଛବିଗୁଡିକ (ସାଧାରଣତ only କେବଳ ଗୋଟିଏ) ସମ୍ପୂର୍ଣ୍ଣ ଭାବରେ ଲୋଡ୍ ହେବା ମାତ୍ରେ gridzyItemLoading ବଦଳାଇବ | କଦାପି ଅପସାରିତ ହେବ ନାହିଁ | |
gridzyItemInitialToVisible | ଆଇଟମ୍ ପ୍ରଥମ ଥର ଦେଖାଯିବା ମାତ୍ରେ ସେଟ୍ ହୋଇଯିବ | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ଦୃଶ୍ୟମାନ ହେବା ମାତ୍ରେ ଅପସାରିତ ହେବ | |
gridzyItemVisible | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ଦୃଶ୍ୟମାନ ହେବା ମାତ୍ରେ ସେଟ୍ ହେବ | ଆଇଟମ୍ ଅଦୃଶ୍ୟ ହେବା ମାତ୍ରେ ଅପସାରିତ ହେବ | |
gridzyItemVisibleToHidden | ଆଇଟମ୍ ଅଦୃଶ୍ୟ ହେବା ମାତ୍ରେ ସେଟ୍ ହୋଇଯିବ | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ଲୁକ୍କାୟିତ ହେବା ମାତ୍ରେ ଅପସାରିତ ହେବ | |
gridzyItemHidden | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ଲୁକ୍କାୟିତ ହେବା ମାତ୍ରେ ସେଟ୍ ହୋଇଯିବ | ଆଇଟମ୍ ଦେଖାଯିବା ମାତ୍ରେ ଅପସାରିତ ହେବ | |
gridzyItemHiddenToVisible | ଆଇଟମ୍ ଦୃଶ୍ୟମାନ ହେବା ଆରମ୍ଭ ହେବା ମାତ୍ରେ ସେଟ୍ ହୋଇଯିବ (ପ୍ରଥମ ଥର ଦେଖାଯିବା ବ୍ୟତୀତ - ଶ୍ରେଣୀ gridzyItemInitialToVisible ଦେଖନ୍ତୁ) | ଆଇଟମ୍ ସଂପୂର୍ଣ୍ଣ ଦୃଶ୍ୟମାନ ହେବା ମାତ୍ରେ ଅପସାରିତ ହେବ | |
gridzyItemVisibleToVisible | ଗ୍ରୀଡରେ କିଛି ପରିବର୍ତ୍ତନ ହେବା ମାତ୍ରେ ସେଟ୍ ହୋଇଯିବ, କିନ୍ତୁ ଆଇଟମ୍ ନିଜେ ଥିଲା ଏବଂ ଦୃଶ୍ୟମାନ ରହିଲା | ପରିବର୍ତ୍ତନ ଆନିମେସନ୍ ସମାପ୍ତ ହେବା ମାତ୍ରେ ଅପସାରିତ ହେବ | |
ଡିଫଲ୍ଟ ଭାବରେ ପ୍ରୋସେସ୍ ସୂଚକ ଏବଂ ପ୍ରତିଛବିଗୁଡିକ ଦେଖାଯିବା ଏବଂ ଅଦୃଶ୍ୟ ହେବା ପାଇଁ ଆନିମେସନ୍ ଗ୍ରୀଜ୍ ମୁଖ୍ୟ CSS ଫାଇଲ୍ ଦ୍ୱାରା ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ ହୋଇଛି |
ଏହି ଉପରୋକ୍ତ CSS ଶ୍ରେଣୀଗୁଡ଼ିକ ସହିତ ଆପଣ ନିଜର ପ୍ରକ୍ରିୟା ସୂଚକ ଏବଂ ଆନିମେସନ୍ ଶ style ଳୀ କରିପାରିବେ | ତୁମକୁ କ’ଣ ନବଲିଖନ କରିବାକୁ ପଡିବ ତାହା ବୁ to ିବା ପାଇଁ ଗ୍ରୀଡି ମୁଖ୍ୟ CSS ଫାଇଲକୁ ଦେଖିବା ପାଇଁ ସାହସ କର | ଭୟ ନାହିଁ, ସେଠାରେ ସବୁକିଛି ଭଲ ଭାବରେ ଡକ୍ୟୁମେଣ୍ଟ୍ ହୋଇଛି |
ଲୋଡିଂକୁ ଅପ୍ଟିମାଇଜ୍ କରନ୍ତୁ |
ଯଦି ଆପଣ ଅନେକ ପ୍ରତିଛବି ବ୍ୟବହାର କରନ୍ତି, ଗ୍ରୀଜ୍ ଶୀଘ୍ର ଗ୍ରୀଡ୍ ନିର୍ମାଣ କରିବାରେ ସାହାଯ୍ୟ କରିବା ଏକ ଭଲ ଚିନ୍ତାଧାରା ହୋଇପାରେ |
ଜମ୍ପିଂ ପ୍ରତିଛବିଗୁଡିକୁ ପ୍ରତିରୋଧ କରନ୍ତୁ |
ଗ୍ରୀଡ୍ ଗଣନା କରିବା ପାଇଁ ଗ୍ରୀଜ୍ ସଂପୂର୍ଣ୍ଣ ଭାବରେ ସମସ୍ତ ପ୍ରତିଛବିଗୁଡ଼ିକର ଅନୁପାତ ଆବଶ୍ୟକ କରେ | ଯଦି କିଛି ଚିତ୍ର ପ୍ରସ୍ତୁତ ଏବଂ ଅନ୍ୟମାନେ ପ୍ରସ୍ତୁତ ନହୁଅନ୍ତି, ତେବେ ଏହି ତଥ୍ୟଗୁଡିକ ଜମ୍ପ୍ ଉପାଦାନରେ ପରିଣତ ହୁଏ | ଯେତେ ଅଧିକ ପ୍ରତିଛବି ଅଛି, ସେତେ ଅଧିକ ବିରକ୍ତିକର ହୋଇପାରେ |
ଏହି ଆଚରଣକୁ ରୋକିବା ପାଇଁ, ସମସ୍ତ 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>ଏହା ପରେ, ଗ୍ରୀଜ୍ ପ୍ରତିଛବିଗୁଡ଼ିକର ପ୍ରକୃତ ଆକାର ଜାଣିବା ବିନା ତୁରନ୍ତ ଗ୍ରୀଡ୍ ଗଣନା କରିପାରିବ |
ଅଳସୁଆ ଲୋଡିଂ |
ଦୃଶ୍ୟମାନ ଦୃଶ୍ୟରେ ଥିବା କେବଳ ପ୍ରତିଛବିଗୁଡ଼ିକୁ ଲୋଡ୍ କରିବାକୁ, କେବଳ ଏହି ପଦକ୍ଷେପଗୁଡ଼ିକୁ ଅନୁସରଣ କରନ୍ତୁ:
- ଉପରେ ବର୍ଣ୍ଣିତ ପରି
widthଏବଂheightଗୁଣ ସନ୍ନିବେଶ କରନ୍ତୁ (ସଠିକ୍ ମୂଲ୍ୟ ବ୍ୟବହାର କରିବାକୁ ନିଶ୍ଚିତ କରନ୍ତୁ) - ନିମ୍ନରେ ଦେଖାଯାଇଥିବା ପରି ସମସ୍ତ
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ଉପାଦାନରେ ରଖନ୍ତୁ |
(କିମ୍ବା ଅନ୍ୟ କ element ଣସି ଉପାଦାନରେ - ଅଧିକ ଅର୍ଥଗତ HTML ଦେଖନ୍ତୁ) - ପ୍ରତ୍ୟେକ
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>ଏହା ପରେ ଯଦି ତୁମେ ପ୍ରତିଛବି ସୂଚକ ଦେଖିବା ଉଚିତ ଯଦି ପ୍ରତିଛବିଗୁଡ଼ିକ ଲୋଡ୍ ହେବାକୁ ସମୟ ନିଏ |
ଫିଲ୍ଟର୍ |
ଗ୍ରୀଡିରେ ଫିଲ୍ଟର୍ ଗୁଡିକ ବହୁତ ସରଳ କିନ୍ତୁ ଶକ୍ତିଶାଳୀ | ଆପଣ କେଉଁ ପ୍ରକାରର ଫିଲ୍ଟର ଆବଶ୍ୟକ କରନ୍ତି ନା କାହିଁକି, ଏହା ବାସ୍ତବ ହୋଇପାରେ | ତୁମକୁ କେବଳ ଆବଶ୍ୟକ, ଟିକିଏ CSS ଏବଂ କିଛି HTML ଫର୍ମ ଉପାଦାନ…
ଏଠାରେ ଏକ କାର୍ଯ୍ୟକାରିତା ଉଦାହରଣ ଅଛି:
<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>ଚାଲ ଏହାକୁ ପର୍ଯ୍ୟାୟ କ୍ରମେ ନିର୍ମାଣ କରିବା |
ପ୍ରଥମେ ଗ୍ରୀଡିଜ୍ ର ସାଧାରଣ HTML ଗଠନ ଆବଶ୍ୟକ ଏବଂ ସମସ୍ତ ଗ୍ୟାଲେରୀ ଆଇଟମ୍ ପାଇଁ ଶ୍ରେଣୀ ନାମ ସେଟ୍ କରିବା ଯାହା ଦ୍ we ାରା ଆମେ ପରେ ଫିଲ୍ଟର୍ କରିପାରିବା |
<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>ବଟନ୍ ବଦଳରେ, ଆପଣ ଅନ୍ୟ ଫର୍ମ ଉପାଦାନଗୁଡିକ ମଧ୍ୟ ବ୍ୟବହାର କରିପାରିବେ ଯେପରିକି ଚେକ୍ ବକ୍ସ, ରେଡିଓ ବଟନ୍, ଫିଲ୍ଡ ଚୟନ ଇତ୍ୟାଦି |
ଯେହେତୁ ଆପଣ ଦେଖିପାରିବେ, ବଟନ୍ଗୁଡ଼ିକର ମୂଲ୍ୟଗୁଡ଼ିକ ସାଧାରଣ CSS ଚୟନକର୍ତ୍ତା | ଆମେ ସମାପ୍ତ କରିବା ମାତ୍ରେ, ଏହିପରି ଏକ ବଟନ୍ ଉପରେ କ୍ଲିକ୍ କରିବା ଦ୍ୱାରା CSS ଚୟନକର୍ତ୍ତା ସହିତ ମେଳ ଖାଉଥିବା ଚିତ୍ରଗୁଡ଼ିକ ପ୍ରଦର୍ଶିତ ହେବ | ଟେକ୍ନିକାଲ୍ ଏହା କେବଳ ଏହି ମୂଲ୍ୟରେ filter ଅପ୍ସନ୍ ସେଟ୍ କରେ |
ଆପଣ ଆହୁରି ଅଧିକ ଜଟିଳ ଚୟନକର୍ତ୍ତା ବ୍ୟବହାର କରିପାରିବେ | ଉଦାହରଣ ସ୍ୱରୂପ :not(.animals) ମଧ୍ୟ କାର୍ଯ୍ୟ କରିବ, ଏବଂ .animals.people ଏବଂ .animals, .people ।
3। ଶେଷରେ, filterControls ଅପ୍ସନ୍ ସେଟ୍ କରି ଆମେ ଏକ 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>ଯେହେତୁ ଆପଣ ଦେଖିପାରିବେ, filterControls ଅପ୍ସନ୍ ପାଇଁ ଆମେ ଏକ CSS ଚୟନକର୍ତ୍ତା ମଧ୍ୟ ବ୍ୟବହାର କରୁ | id ଆଟ୍ରିବ୍ୟୁଟ୍ ସହିତ div କଣ୍ଟେନର୍ କେବଳ ସେହି CSS ଚୟନକର୍ତ୍ତା ମାଧ୍ୟମରେ ଚୟନ କରିବାକୁ ବଟନ୍ଗୁଡ଼ିକୁ ସହଜ କରିବାକୁ ସେବା କରେ |
ତାହା ହେଉଛି!
ଯଦି ଆପଣ ଏକ ଜାଭାସ୍କ୍ରିପ୍ଟ ସମାଧାନ ପସନ୍ଦ କରନ୍ତି, API ଯାଞ୍ଚ କରନ୍ତୁ |
API
ଯଦିଓ ଗ୍ରୀଡଜୀଙ୍କ ନିଜସ୍ୱ API ଅଛି, ଅଧିକାଂଶ ଜିନିଷ ଏହା ବିନା କରାଯାଇପାରିବ, କେବଳ DOM କୁ ବ୍ୟବହାର କରି | ଗ୍ରୀଡି ଏହାକୁ ଲକ୍ଷ୍ୟ କରିବ ଏବଂ ଗ୍ରୀଡ୍ ଆଡଜଷ୍ଟ କରିବ | କିନ୍ତୁ ସେଠାରେ ମଧ୍ୟ ଏକ ଶକ୍ତିଶାଳୀ API ଅଛି…
DOM କୁ ପରିଚାଳନା କରିବା |
ସମସ୍ତ ଡକ୍ୟୁମେଣ୍ଟ୍ ଅବଜେକ୍ଟ ମଡେଲ୍ (DOM) ମନିପୁଲେସନ୍ ପାଇଁ ଆମକୁ ପ୍ରଥମେ କଣ୍ଟେନର୍ ଉପାଦାନ ଆବଶ୍ୟକ:
// 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');DOM କୁ ନିୟନ୍ତ୍ରଣ କରିବା ବିଷୟରେ ଅଧିକ ଆପଣ MDN ୱେବ୍ ଡକସ୍ ରେ ପାଇପାରିବେ | ଉପଲବ୍ଧ DOM ର ଏକ ପରିଚୟ ମଧ୍ୟ ଅଛି |
ମାଲିକାନା API
API ବ୍ୟବହାର କରିବାକୁ, ଆମକୁ ପ୍ରଥମେ ଗ୍ରୀଜ୍ ଇନଷ୍ଟାନ୍ସ ଦରକାର, ଯାହା ଗ୍ରୀଡି କଣ୍ଟେନର୍ ଉପାଦାନ ସହିତ ବାନ୍ଧେ:
// 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 ସେଟିଂ କରୁଛି ଯାହାକି କ valid ଣସି ବ valid ଧ CSS ଚୟନକର୍ତ୍ତା ହୋଇପାରେ:
// 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 ପରଠାରୁ DEPRECATED |
ଏହା ପରିବର୍ତ୍ତେ ଆଧୁନିକ ଏବଂ ଅଧିକ ନମନୀୟ ଘଟଣା ବ୍ୟବହାର କରନ୍ତୁ | ବିବରଣୀ ପାଇଁ ପରବର୍ତ୍ତୀ ବିଭାଗ ଦେଖନ୍ତୁ |
Gridzy.js 2 କଲବ୍ୟାକ୍ ଫଙ୍କସନ୍ ପାଇଁ କିଛି ବିକଳ୍ପକୁ ସମର୍ଥନ କରେ | ସେଗୁଡିକ କେବଳ ମାଲିକାନା API ମାଧ୍ୟମରେ ସେଟ୍ ହୋଇପାରିବ, କିନ୍ତୁ ଅନ୍ୟାନ୍ୟ ବିକଳ୍ପ ପରି:
// 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 ଗ୍ରୀଜ୍ ଉଦାହରଣ ପ୍ରଦାନ କରେ |
API - ଗ୍ଲୋବାଲ୍ |
କିଛି ଫଙ୍କସନ୍ ଅଛି ଯାହା ଗ୍ରୀଜ୍ ଉଦାହରଣରୁ ସ୍ are ାଧୀନ ଅଟେ | ତେଣୁ ଆମକୁ ପୂର୍ବରୁ ଏକ ଉଦାହରଣ ପାଇବା ଆବଶ୍ୟକ ନାହିଁ |
ଡିଫଲ୍ଟ ବିକଳ୍ପ ପାଆନ୍ତୁ |
// 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 ମାଧ୍ୟମରେ ପୁନ et ସେଟ୍ ହେବ, ତେବେ ଏହା ନୂତନ ଡିଫଲ୍ଟ ମୂଲ୍ୟ ବ୍ୟବହାର କରିବ |
// set default option values
Gridzy.setDefaultOptions({
spaceBetween: 10,
layout: 'waterfall'
});ସର୍ବଭାରତୀୟ ସ୍ତରରେ ବିକଳ୍ପ ସେଟ୍ କରିବା ପାଇଁ ଆପଣ ଏହାକୁ ବ୍ୟବହାର କରିପାରିବେ, ଯଦି ଆପଣ DOM ପ୍ରସ୍ତୁତ ହେବା ପୂର୍ବରୁ ଏହାକୁ ଡାକନ୍ତି | ତେଣୁ ତୁମେ ଆଉ ଗୁଣବତ୍ତା ଭାବରେ ବିକଳ୍ପ ସେଟ୍ କରିବା ଆବଶ୍ୟକ କରିବ ନାହିଁ |
ସ୍ୱୟଂଚାଳିତତା |
ଯେପର୍ଯ୍ୟନ୍ତ Gridzy.js 2 ର ସମସ୍ତ ସ୍ୱୟଂଚାଳିତତା ସକ୍ରିୟ ଅଛି, ନିମ୍ନଲିଖିତ ପଦ୍ଧତିଗୁଡ଼ିକର କ is ଣସି ଆବଶ୍ୟକତା ନାହିଁ | କିନ୍ତୁ ଗ୍ରୀଡଜୀକୁ ଅଧିକ ପାରମ୍ପାରିକ ଉପାୟରେ ବ୍ୟବହାର କରିବା ପାଇଁ ସ୍ୱୟଂଚାଳିତତା ବନ୍ଦ ହୋଇପାରିବ:
// 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();ଏକକ ଶିଶୁ ଉପାଦାନକୁ ମାନୁଆଲ୍ ସିଙ୍କ୍ କରନ୍ତୁ |
ସାଧାରଣତ needed ଆବଶ୍ୟକ ହୁଏ ନାହିଁ, ଅତି ବିରଳ ଘଟଣା ବ୍ୟତୀତ |
// 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();