|
Server IP : 111.118.215.156 / Your IP : 216.73.216.167 Web Server : Apache System : Linux md-in-26.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : azasoqqa ( 1858) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/azasoqqa/public_html/vsrcbse.com/admin/javascript/pages/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
/*! ========================================================================
* media.js
* Page/renders: page-media.html
* Plugins used: shuffle, magnific-popup
* ======================================================================== */
$(function () {
// Lightbox
// ================================
$("#shuffle-grid").magnificPopup({
delegate: ".magnific",
type: "image",
gallery: {
enabled: true
}
});
// Shuffle
// ================================
var $grid = $("#shuffle-grid"),
$filter = $("#shuffle-filter"),
$sort = $("#shuffle-sort"),
$sizer = $grid.find("shuffle-sizer");
// instatiate shuffle
$grid.shuffle({
itemSelector: ".shuffle",
sizer: $sizer
});
// Filter options
(function () {
$filter.on("click", ".btn", function () {
var $this = $(this),
isActive = $this.hasClass("active"),
group = isActive ? "all" : $this.data("group");
// Hide current label, show current label in title
if (!isActive) {
$("#shuffle-filter .active").removeClass("active");
}
$this.toggleClass("active");
// Filter elements
$grid.shuffle("shuffle", group);
});
})();
// Sorting options
(function () {
$sort.on("change", function () {
var sort = this.value,
opts = {};
// We're given the element wrapped in jQuery
if (sort === "date-created") {
opts = {
reverse: true,
by: function ($el) {
return $el.data("date-created");
}
};
} else if (sort === "title") {
opts = {
by: function ($el) {
return $el.data("title").toLowerCase();
}
};
}
// Filter elements
$grid.shuffle("sort", opts);
});
})();
});