Server IP : 149.202.105.228 / Your IP : 216.73.216.18 Web Server : Apache System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : atfycaf ( 116275) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/atfycaf/www/js/jsF/ |
Upload File : |
var mSwipeD = false; var resizeTimer; $(document).ready(function() { $(document).on("click", ".galleryPhoto img", function() { var sI = $(this).data("pid"); var iOrder = new Array(); $(".galleryPhoto img").each(function() { var thisID = $(this).data("pid"); iOrder.push(thisID); }); var serialized = JSON.stringify(iOrder); var postData = "sI=" + sI + "&iO=" + serialized; $("body").append('<div id="photoGalleryBG"><div id="photoGalleryContent"></div><div id="galleryLoading"><img src="/images/refreshWaiting.gif" width="64" height="64" alt="Loading, Please Wait..." title="Loading, Please Wait..."></div></div>'); $("body").append('<div id="swipeInstr"><img src="/images/swipe.png" alt="Swipe for more pictures" width="100"></div>'); $("body").addClass("fixed"); $("#photoGalleryBG, #galleryLoading").fadeIn("slow"); $.ajax({ url: "/photoGalleryView.php", type: "POST", data: "sI=" + sI + "&iO=" + serialized, success: function(data) { $("#photoGalleryContent").html(data); $("#galleryLoading").delay(600).fadeOut("slow"); var screenWidth = $(window).width(); var numSlides = $(".pGSGallery .pGPhoto").length; slideWidth = numSlides * 100; $(".pGSGallery").width(slideWidth + "vw"); if (screenWidth < 769) { if (mSwipeD == false) { $("#swipeInstr").fadeIn("slow"); setTimeout(function() { $("#swipeInstr").fadeOut("fast"); }, 5000); mSwipeD = true; } } var active = $(".pGSGallery .activeSlide"); var slideTo = active.index(); var slideToMax = parseInt(numSlides) - 1; if (screenWidth > 767) { $("#pGLeft").fadeIn("slow"); $("#pGRight").fadeIn("slow"); } var marginL = "-" + parseInt(slideTo) * parseInt(100) + "vw"; $(".pGSGallery").animate({ "marginLeft": marginL }); clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { resizeTitle(); }, 250); $(".pGSPhotoContainer").swipe({ swipe:function(event, direction, distance, duration, fingerCount, fingerData) { slideGallery(direction); }, threshold:15 }); } }); }); $(document).on("click", "#photoGalleryClose", function() { $("#photoGalleryBG").fadeOut("fast", function() { $("#photoGalleryContent").html(""); $("body").removeClass("fixed"); $("#photoGalleryBG").remove(); }); }); $(document).on("click", "#photoGalleryBG", function(e) { var thisID = $(e.target).attr('id'); if (thisID == "photoGalleryBG") { $("#photoGalleryBG").fadeOut("fast", function() { $("#photoGalleryContent").html(""); $("body").removeClass("fixed"); $("#photoGalleryBG").remove(); }); } }); $(document).on("click", "#pGLeft", function() { slideGallery("right"); }); $(document).on("click", "#pGRight", function() { slideGallery("left"); }); $( window ).resize(function() { clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { resizeTitle(); }, 250); }); function slideGallery(direction) { var wW = $(window).width(); var numP = parseInt($(".pGPhoto").length) - 1; if (direction == "right") { var active = $(".pGSGallery .activeSlide"); var prev = active.prev(); var index = active.index(); var last = $(".pGPhoto").last(); var slideTo; var addClassTo; if (index == 0) { slideTo = last.index(); addClassTo = last; } else { slideTo = prev.index(); addClassTo = prev; } var marginL = "-" + parseInt(slideTo) * parseInt(100) + "vw"; $(".pGSGallery").animate({ "marginLeft": marginL }); $(active).removeClass("activeSlide"); $(addClassTo).addClass("activeSlide"); } else if (direction == "left") { var active = $(".pGSGallery .activeSlide"); var next = active.next(); var index = active.index(); var first = $(".pGPhoto").first(); var slideTo; var addClassTo; if (index == numP) { slideTo = first.index(); addClassTo = first; } else { slideTo = next.index(); addClassTo = next; } var marginL = "-" + parseInt(slideTo) * parseInt(100) + "vw"; $(".pGSGallery").animate({ "marginLeft": marginL }); $(active).removeClass("activeSlide"); $(addClassTo).addClass("activeSlide"); } } function resizeTitle () { $(".pGPhoto").each(function() { var thisDiv = $(this); var imgWidth = thisDiv.children("img").width(); var marginL = parseInt(imgWidth) / 2; imgWidth = parseInt(imgWidth) - 20; thisDiv.children(".pGPhotoTitle").width(imgWidth); thisDiv.children(".pGPhotoTitle").css("margin-left", "-" + marginL + "px"); }); } });