HEX
Server: nginx/1.16.1
System: Linux iZ7xv2zauie3qihz0jlnrxZ 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: www (1000)
PHP: 7.2.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/shzthfdcpg.com/wp-content/themes/shzhaotao/js/script1.js

function sizeChoosing() {
	$(".size .options").hide();
	
	$(".carousel").off("click").on("click", ".size", function() {
		$(this).clearQueue();
		
		if ($(this).hasClass("shown"))
		{
			$(this).clearQueue().removeClass("shown").find(".options").slideUp(800);
		}
		else
		{
			$(this).clearQueue().addClass("shown").find(".options").slideDown(800);
		}
	});
	
	$(".carousel").on("click", ".option", function() {
		$(this).closest(".size").find(".header .number").html($(this).text());
	});
}

function chooseColor() {
	$(".carousel").on("click", ".choose-color div", function() {
		var img_path = findPathToDirectory($(this).closest(".flex-item").find(".good-image img").attr("src")) + $(this).attr("class") + ".png";
		
		$(this).closest(".flex-item").find(".good-image img").stop().fadeTo("slow", 0, function() {
			$(this).attr("src", img_path);
		}).fadeTo("slow", 1);
	});
}

function findPathToDirectory(path_to_file) {
	return path_to_file.slice(0, path_to_file.lastIndexOf("/") + 1);
}

function adjustIndexesOfCarousel() {
	$(".carousel").each(function() {
		setupIndexesOfCarousel($(this));
	});
	$(".carousel").on("slid.bs.carousel", function() {
		setupIndexesOfCarousel($(this));
	});
}

function setupIndexesOfCarousel(carousel) {
	var total_number = $(carousel).find(".item").length;
	var current_number = $(carousel).find(".item.active").index() + 1;
	
	$(carousel).find(".index").text(String(current_number) + " / " + String(total_number));
}

function preloadImages(images) { 
  for (var i = 0; i < images.length; i++) {
    $("<img />").attr("src", images[i]);
  }
}

function collectImagesForPreloading() {
	var images = [];
	
	$(".carousel .choose-color").each(function() {
		var files = [];
		
		$(this).find("div").each(function() {
			files.push($(this).attr("class"));
		});
		
		var directory = findPathToDirectory($(this).closest(".flex-item").find(".good-image img").attr("src"));
		
		for (var i = 0; i < files.length; i++)
		{
			images.push(directory + files[i] + ".png");
		}
	});
	
	return images;
}

function preloadImagesForCarousel() {
	var images = collectImagesForPreloading();
	
	preloadImages(images);
}