new.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. var ProductId = "",
  2. ProductIdCountDown = "",
  3. ProductAttrId = [],
  4. ProductAttrInfo = 0;
  5. $(document).ready(function () {
  6. init();
  7. $(window).scroll(WindowScroll);
  8. imgShow();
  9. });
  10. init = function () {
  11. getProductInfo();
  12. }
  13. var getProductInfo = function () {
  14. //var pid = window.location.pathname.substr(1) || getUrlParam("pid");
  15. var pid = getUrlParam("pid") || window.location.pathname.substr(1);
  16. var parameter = urlEncode(["SelectProduct", pid]);
  17. $.ajax({
  18. type: "post",
  19. url: "/malai/php/index.php",
  20. data: {mode: parameter},
  21. dataType: "json",
  22. success: function (data) {
  23. $("#PageLoading").css({"display": "none"});
  24. $("#PageWarp").css({"display": "block"});
  25. printProductInfo(data[0][0]);
  26. PrintProductAttribute(data[0][0].ProductAttr);
  27. }
  28. });
  29. }
  30. var printProductInfo = function (data) {
  31. ProductAttrId = data;
  32. ProductId = data.ProductId;
  33. ProductIdCountDown = data.CountDown;
  34. $("#ProductName").html(data.ProductName);
  35. $("#ProductPrice").html(Math.ceil(data.ProductPrice));
  36. $("#ColorPrice").html("฿" + Math.ceil(data.ProductPrice));
  37. $("#ProductPrimeCost").html(Math.ceil(data.ProductPrimeCost));
  38. // $("#ProductInfo").html(data.ProductInfo);
  39. $("#ProductInfo").html(unescape(data.ProductInfo));
  40. $("#Discount").html(data.Discount);
  41. $("#Sold").html(data.Sold);
  42. $("#Promotion").html(data.Promotion);
  43. $("#ProductInfo img").css({"width":"100%","height":"auto"});
  44. // countTime(ProductIdCountDown);
  45. // countDown(ProductIdCountDown);
  46. setInterval(function () {
  47. freshTime();
  48. }, 1000);
  49. var banner = JSON.parse(data.ProductAttr)["7b824b9c-738b-11e8-a479-0610c52349b6"],
  50. color = JSON.parse(data.ProductAttr)["69d4e108-738a-11e8-a479-0610c52349b6"],
  51. size = JSON.parse(data.ProductAttr)["d6d6361b-acea-11e8-bbc6-0a4b7569e232"],
  52. classs = JSON.parse(data.ProductAttr)["cfb738c4-bff6-11e8-bbc6-0a4b7569e232"],
  53. comment = JSON.parse(data.ProductAttr)["d5cca263-c224-11e8-bbc6-0a4b7569e232"];
  54. $("#Color").html("");
  55. for (var i in color) {
  56. for (var j in color[i]) {
  57. var a = '<a _src=' + color[i][j] + ' onclick = itemClick(this)>' + j + '</a>';
  58. $("#Color").append($(a));
  59. }
  60. }
  61. $("#Color a").eq(0).addClass("checked");
  62. $("#ColorBanner").attr("src", $("#Color a").eq(0).attr("_src"));
  63. // ProductAttrId.push(escape($("#Color a").eq(0).html()), escape($("#Color a").eq(0).attr("_src")));
  64. if (size && !$.isEmptyObject(size)) {
  65. for (var i in size) {
  66. for (var j in size[i]) {
  67. var a = '<a onclick = itemClick(this)>' + size[i][j] + '</a>';
  68. $("#Size").append($(a));
  69. }
  70. }
  71. $("#Size a").eq(0).addClass("checked");
  72. }
  73. else {
  74. $("#Size").parent().hide();
  75. }
  76. var num = 0;
  77. for (var j in banner) {
  78. num++;
  79. }
  80. for (var i in banner) {
  81. for (var j in banner[i]) {
  82. var li = '<li class="item slide"><img src="' + banner[i][j] + '"/></li>';
  83. $(".scroller").append(li);
  84. var i = '<i><span class="pagination">' + (parseInt(j) + 1) + '/' + num + '</span></i>';
  85. $(".nav").append(i);
  86. $(".nav i").eq(0).addClass("current");
  87. }
  88. }
  89. bannerMove();
  90. var mp4 = $("#ProductInfo img.edui-upload-video"), el;
  91. for (var i = 0; i < mp4.length; i++) {
  92. var url = mp4.eq(i).attr("_url");
  93. el = '<video src=' + url + ' controls="controls" preload="auto" width = "100%"></video>';
  94. mp4.eq(i).after(el);
  95. mp4.eq(i).remove();
  96. }
  97. mp4.remove();
  98. //就是这一块
  99. if (comment && !$.isEmptyObject(comment)) {
  100. $("#comment").eq(0).html("");
  101. for (var i in comment) {
  102. //for (var j = 0;j<=i;j++) {
  103. $("#comment").eq(0).append(
  104. $('<li>' +
  105. '<div style="margin-bottom:8px; color: #999;font-size:12px">' +
  106. '<span>' + comment[i].name + '</span>' +
  107. '<span style="float: right;">' +
  108. '<span lass="reviewStar size1 star5">' + comment[i].time + '</span>' +
  109. '</span>' +
  110. '</div>' +
  111. '<div>' +
  112. '<p style="margin-bottom: 8px;font-size: 14px;word-break: break-all;">' + comment[i].text + '</p>' +
  113. '<div class="imgg" style="margin-bottom:10px;overflow: hidden">' + '</div>' +
  114. // '<p style="position: relative;min-height: 10px;">' +
  115. // '<span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">' + comment[i].time + '</span>' +
  116. // '</p>' +
  117. '</div>' +
  118. '</li>'
  119. ));
  120. if (comment[i].imgurl != "") {
  121. var CreateCommentImg = function (el, img, flag) {
  122. img = flag ? '/malai/' + img : img;
  123. // var div = '<img class="pimg" style="z-index:0;" src="' + img + '">';
  124. // div.onclick=function(){
  125. // var _this = $(this);//将当前的pimg元素作为_this传入函数
  126. // imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
  127. // }
  128. $('<img>', {src: img,}).css({zIndex: 0}).appendTo($(".imgg").eq(i));
  129. // $(".imgg").eq(i).append(div);
  130. }
  131. var img = comment[i]['imgurl'].split(",");
  132. img.forEach(function (val) {
  133. CreateCommentImg(el, val, false);
  134. });
  135. }
  136. //}
  137. }
  138. // $(".u-format .items").eq(0).eq(0).addClass("tab-sel");
  139. }
  140. else {
  141. // Roll();
  142. $(".ProductEvaluate")[0].style.display = "none";
  143. }
  144. }
  145. var bannerMove = function () {
  146. var glide = new Glide('.module-preview ', {
  147. autoplay: 3000
  148. });
  149. glide.on(['mount', 'run.after'], function () {
  150. $(".nav i").removeClass("current");
  151. $(".nav i").eq(glide._i).addClass("current");
  152. })
  153. glide.mount();
  154. }
  155. var ToTop = function () {
  156. $("html,body").scrollTop(0);
  157. }
  158. var ToProductInfo = function () {
  159. $("html,body").scrollTop($(".ProductInfo").offset().top - 50);
  160. // $("html,body").animate({scrollTop: $(".ProductInfo").offset().top - 50});
  161. }
  162. var ToProductEvaluate = function () {
  163. $("html,body").scrollTop($(".ProductEvaluate").offset().top);
  164. // $("html,body").animate({scrollTop: $(".ProductEvaluate").offset().top});
  165. }
  166. function freshTime() {
  167. var arr = ProductIdCountDown.split(/[- : \/]/);
  168. var endtime = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]);
  169. var nowtime = new Date();
  170. var lefttime = parseInt(endtime.getTime() - nowtime.getTime());//这是毫秒,如果再/1000就是秒
  171. if (lefttime <= 0) {
  172. var toyear = new Date().getFullYear();
  173. var tomonth = new Date().getMonth() + 1;
  174. var today = new Date().getDate() + 2;
  175. arr[0] = toyear;
  176. arr[1] = tomonth;
  177. arr[2] = today;
  178. endtime = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]);
  179. lefttime = parseInt(endtime.getTime() - nowtime.getTime());//这是毫秒,如果再/1000就是秒
  180. }
  181. var hm = 60 * 60 * 1000;
  182. var h = parseInt((lefttime / hm));
  183. var mm = 60 * 1000;
  184. var m = parseInt((lefttime / mm) % 60);
  185. var s = parseInt((lefttime / 1000) % 60);
  186. m = checktime(m);
  187. s = checktime(s);
  188. $("#J_TimeHour").html(h);
  189. $("#J_TimeMin").html(m);
  190. $("#J_TimeSec").html(s);
  191. if (lefttime < 0) {
  192. $("#J_TimeHour").html(0);
  193. $("#J_TimeMin").html(0);
  194. $("#J_TimeSec").html(0);
  195. }
  196. }
  197. //倒计时效果js代码
  198. function checktime(i) {
  199. if (i < 10) {
  200. i = "0" + i;
  201. }
  202. else {
  203. i = i;
  204. }
  205. return i;
  206. }
  207. var WindowScroll = function () {
  208. var top = $(document).scrollTop();
  209. if (top > $(".group-warp").eq(0).height() * 0.2) {
  210. $("#head").addClass("transparent");
  211. }
  212. if (top >= $(".ProductInfo").offset().top - 100) {
  213. $("#head").addClass("transparent");
  214. $("#head li").removeClass("active");
  215. $("#head li").eq(1).addClass("active");
  216. }
  217. // if (top >= $(".ProductEvaluate").offset().top - 500) {
  218. // $("#head").addClass("transparent");
  219. // $("#head li").removeClass("active");
  220. // $("#head li").eq(2).addClass("active");
  221. // }
  222. // if (top < $(".ProductEvaluate").offset().top - 500) {
  223. // $("#head").addClass("transparent");
  224. // $("#head li").removeClass("active");
  225. // $("#head li").eq(1).addClass("active");
  226. // }
  227. if (top <= $(".ProductInfo").offset().top - 100) {
  228. $("#head").addClass("transparent");
  229. $("#head li").removeClass("active");
  230. $("#head li").eq(0).addClass("active");
  231. }
  232. if (top <= $(".group-warp").eq(0).height() * 0.2) {
  233. $("#head").removeClass("transparent");
  234. }
  235. }
  236. var showPage = function () {
  237. // if ($(".widgets-cover").hasClass("show")) {
  238. // $(".widgets-cover").removeClass("show");
  239. // $("body").css({"position": "static", "top": "0px", "scroll-behavior": "unset"});
  240. // }
  241. // else {
  242. // $("body").css({"position": "fixed", "top": "0px", "scroll-behavior": "unset"});
  243. // $(".widgets-cover").addClass("show");
  244. // }
  245. if ($("#page-order").css("display") == "block") {
  246. $("#PageWarp").css({display: "block"});
  247. $("#page-order").animate({left: '100%'}, "", function () {
  248. $("#page-order").css({display: "none"});
  249. });
  250. }
  251. else {
  252. $("#page-order").css({display: "block"});
  253. $("#page-order").animate({left: '0'}, "", function () {
  254. $("#PageWarp").css({display: "none"});
  255. });
  256. }
  257. }
  258. /*********************************************下单页面事件区域*************************************************/
  259. var PrintProductAttribute = function (obj) {
  260. obj = JSON.parse(obj);
  261. var classs = obj['cfb738c4-bff6-11e8-bbc6-0a4b7569e232'],
  262. color = obj['69d4e108-738a-11e8-a479-0610c52349b6'],
  263. size = obj['d6d6361b-acea-11e8-bbc6-0a4b7569e232'];
  264. var
  265. colorel = $(".count_atrr .con"),
  266. sizeel = $(".count_size .con");
  267. // var isclasss = true;
  268. //打印图片颜色分类
  269. colorel.html("");
  270. // for (var i in color) {
  271. // for (var j in color[i]) {
  272. // var div = '<div class="tab" onclick="ColorClick(this,\'' + j + '\')"><img src="' + color[i][j] + '"></div>';
  273. // colorel.append($(div));
  274. // if (i == 0) {
  275. // // ColorClick(colorel.find(".tab").eq(0), j);
  276. // colorel.find(".tab").eq(0).addClass("tab-sel");
  277. // colorel.eq(0).parent().find("span").html(j);
  278. // }
  279. // }
  280. // }
  281. for (var j in color) {
  282. for (var i in color[j]) {
  283. if (i == "cname") {
  284. cname = color[j][i];
  285. }
  286. else {
  287. img = color[j][i];
  288. if (img.split("/malai").length > 1) {
  289. src = img;
  290. }
  291. else {
  292. src = "/malai/" + img;
  293. }
  294. name = i;
  295. }
  296. }
  297. var div = '<div class="tab" cname="' + cname + '" onclick="ColorClick(this,\'' + name + '\')"><img src="' + src + '"></div>';
  298. colorel.append($(div));
  299. if (j == 0) {
  300. // ColorClick(colorel.find(".tab").eq(0), j);
  301. colorel.find(".tab").eq(0).addClass("tab-sel");
  302. colorel.eq(0).parent().find("span").html(name);
  303. }
  304. }
  305. //打印尺寸分类
  306. if (size && !$.isEmptyObject(size)) {
  307. sizeel.html("");
  308. for (var i in size) {
  309. for (var j in size[i]) {
  310. var div = '<label class="tab" onclick="SizeClick(this)"><span>' + size[i][j] + '</span></label>';
  311. sizeel.append($(div));
  312. if (i == 0) {
  313. sizeel.find(".tab").eq(0).addClass("tab-sel");
  314. }
  315. }
  316. }
  317. }
  318. else {
  319. sizeel.parent().remove();
  320. }
  321. var classsel = $(".count_classs .con"), classs_obj, classs_a;
  322. //打印套餐
  323. if ($.isEmptyObject(classs)) {
  324. $(".count_classs .con").parent().remove();
  325. ProductAttrId.OrderNum = 1;
  326. }
  327. else {
  328. classsel.html("");
  329. $.each(classs, function (i, val) {
  330. ProductAttrInfo++;
  331. classs_obj = val;
  332. $.each(val, function (j, val1) {
  333. if (j == "type") {
  334. if ($(".dt-paramselect .meal").length != parseInt(val1)) {
  335. while (parseInt(val1) > $(".dt-paramselect .meal").length) {
  336. classs_a = $(".meal").eq(0).clone();
  337. classs_a.hide();
  338. $(".dt-paramselect").append(classs_a);
  339. }
  340. // for (var k = 0; k < parseInt(val1) - $(".dt-paramselect .meal").length; k++) {
  341. // classs_a = $(".meal").eq(0).clone();
  342. // classs_a.hide();
  343. // $(".dt-paramselect").append(classs_a);
  344. // }
  345. }
  346. }
  347. else if (j != "type") {
  348. var div = '<label class="tab" onclick="ClasssClick(this,\'' + j + '\',\'' + val.type + '\')"><span>' + val1 + '</span></label>';
  349. classsel.append($(div));
  350. // div.onclick = function () {
  351. // alert();
  352. // }
  353. // $(div).bind('click', function () {
  354. // alert();
  355. // });
  356. }
  357. });
  358. });
  359. $(".dt-paramselect").append($(".u-fornum"));
  360. $(".count_classs label").eq(0).click();
  361. /*
  362. if (ProductAttrInfo == 1) {
  363. ClasssClick($(".count_classs label").eq(0), ProductAttrId.ProductPrice, classs[0].type);
  364. }
  365. else {
  366. ClasssClick($(".count_classs label").eq(0), ProductAttrId.ProductPrice, ProductAttrInfo);
  367. }
  368. */
  369. // for (var i in classs) {
  370. // for (var j in classs[i]) {
  371. // if (j == "type") {
  372. // // $(".u-fornum").before(colorel.parent().clone().hide());
  373. // // $(".u-fornum").before(sizeel.parent().clone().hide());
  374. // $(".secondsetmeal").append(colorel.parent().clone());
  375. // $(".secondsetmeal").append(sizeel.parent().clone());
  376. // }
  377. // else if (j != "type") {
  378. // var div = '<label class="tab" onclick="ClasssClick(this,\'' + j + '\')"><span>' + classs[i][j] + '</span></label>';
  379. // classsel.append($(div));
  380. // }
  381. // }
  382. // }
  383. // ClasssClick($(".count_classs label").eq(0));
  384. }
  385. console.log(obj);
  386. }
  387. /**/
  388. var ClasssClick = function (el, val, type) {
  389. $(el.parentNode).find(".tab").removeClass("tab-sel");
  390. $(el).addClass("tab-sel");
  391. $(".meal").hide();
  392. $(".meal").eq(0).show();
  393. for (var i = 0; i < parseInt(type); i++) {
  394. $(".meal").eq(i).show();
  395. }
  396. type ? ProductAttrId.OrderNum = type : "";
  397. val ? ProductAttrId.ProductPrice = val : "";
  398. }
  399. /*选择颜色点击事件*/
  400. var ColorClick = function (el, val) {
  401. $(el.parentNode).find(".tab").removeClass("tab-sel");
  402. $(el).addClass("tab-sel");
  403. $(el.parentNode.parentNode).find("span").html(val);
  404. // $(el.parentNode).children().removeClass("checked");
  405. // // $("#Color a").removeClass("checked");
  406. // $(el).addClass("checked");
  407. // if ($(el.parentNode).attr("id") === "Color") {
  408. // $("#ColorBanner").attr("src", $(el).attr("_src"));
  409. // }
  410. // var banner = escape($("#ColorBanner").attr("src")),
  411. // color = escape($("#Color a.checked").html()),
  412. // size = escape($("#Size a.checked").html());
  413. // ProductAttrInfo = [];
  414. // ProductAttrInfo.push(banner, color, size);
  415. }
  416. /*选择尺寸点击事件*/
  417. var SizeClick = function (el) {
  418. $(el.parentNode).find(".tab").removeClass("tab-sel");
  419. $(el).addClass("tab-sel");
  420. }
  421. /*购买数量添加*/
  422. var addnumber = function () {
  423. $('.textWrap .num').html(parseInt($('.textWrap .num').html()) + 1);
  424. }
  425. /*购买数量减少*/
  426. var minnumber = function () {
  427. if (parseInt($('.textWrap .num').html()) > 1) {
  428. $('.textWrap .num').html(parseInt($('.textWrap .num').html()) - 1);
  429. }
  430. }
  431. /*点击购买函数*/
  432. var goShop = function () {
  433. // var num = parseInt($("#number").val()),
  434. // attr = ProductAttrInfo.join(),
  435. // str = "shop.html?pid=" + ProductId + "&attr=" + attr + "&num=" + num;
  436. var num = parseInt($("#number").text()),
  437. obj = [],
  438. attr = {},
  439. numobj = {},
  440. url = "shop.html?pid=" + ProductId + "&attr=",
  441. str = "";
  442. numobj["Number"] = num;
  443. numobj["Money"] = ProductAttrId.ProductPrice;
  444. obj.push(numobj);
  445. for (var i = 0; i < ProductAttrId.OrderNum; i++) {
  446. attr = {};
  447. attr["color"] = $(".meal").eq(i).find(".tt span").eq(0).text();
  448. attr["img"] = $(".meal").eq(i).find("div.tab-sel img").attr("src");
  449. attr['cname'] = $(".meal").eq(i).find("div.tab-sel img").parent().attr("cname");
  450. attr["size"] = $(".meal").eq(i).find("label.tab-sel span").text();
  451. obj.push(attr);
  452. }
  453. OrderPrice = parseInt(obj[0].Number) * parseInt(obj[0].Money);
  454. //facebook购物车推广事件,请勿删除!
  455. fbq('track', 'AddToCart', {
  456. value: OrderPrice,
  457. currency: 'MYR',
  458. content_ids: 'ProductAttrId.ProductRemarks',
  459. content_type: 'product_group',
  460. });
  461. str = escape(JsonToString(obj));
  462. url += str;
  463. console.log(url);
  464. window.location.href = url;
  465. }
  466. getUrlParam = function (name) {
  467. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  468. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  469. if (r != null) return unescape(r[2]);
  470. return null; //返回参数值
  471. }
  472. urlEncode = function (arr) {
  473. var i; //循环初始化
  474. for (i = 0; i < arr.length; i++) {
  475. arr[i] = encodeURIComponent(encodeURIComponent(arr[i]));
  476. }
  477. return arr.join();
  478. }
  479. // Roll = function () {
  480. // //$(".marquee ul").css('position', 'absolute');
  481. // animate();
  482. // };
  483. // animate = function () {
  484. // var boxHeight = $('.marquee').height();
  485. // var ulHeight = $(".marquee ul").height();
  486. // $(".marquee").css('top', 0);
  487. // $(".marquee").animate({scrollTop: $(".marquee")[0].scrollTop == 0 ? (ulHeight - boxHeight) : 0}, 10000, animate);
  488. // }
  489. //json转换为string
  490. var JsonToString = function (obj) {
  491. var i,
  492. _type = false,
  493. _str = "",
  494. _type = typeof (obj); //获取类型
  495. //开始序列化
  496. if (obj == null) {
  497. }
  498. else {
  499. obj = obj.valueOf(); //获取值 同时类型也为对应
  500. if ("boolean,number".indexOf(_type) > -1) {//bool和number类型转化
  501. _str = obj.toString();
  502. }
  503. else if (_type == "string") {//json处理字符串时需要加上 "\""符号
  504. _str = "\"" + obj + "\"";
  505. }
  506. else if (typeof obj == "array") { //数组处理
  507. _str = "[";
  508. for (i = 0; i < obj.length; i++) {
  509. _str += JsonToString(obj[i]) + ((i < obj.length - 1) ? "," : "")
  510. }
  511. ;_str += "]";
  512. return _str
  513. }
  514. else {//object处理
  515. _str = "{";
  516. for (i in obj) {
  517. if (obj.hasOwnProperty(i)) {
  518. if (_str.length > 1) {
  519. _str += ","
  520. }
  521. ;_str += "\"" + i + "\":" + JsonToString(obj[i]);
  522. }
  523. }
  524. _str += "}";
  525. }
  526. return _str;
  527. }
  528. }
  529. //评论图片查看
  530. var imgShow = function () {
  531. var mySwiper = new Swiper('.swiper-container2', {
  532. loop: false,
  533. pagination: '.swiper-pagination2',
  534. });
  535. $("#comment").on("click", ".imgg img",
  536. function () {
  537. // var imgBox = $(this).parents(".imgg").find("img");
  538. var imgBox = $("#comment .imgg img");
  539. var i = $(imgBox).index(this);
  540. $(".big_img .swiper-wrapper").html("")
  541. for (var j = 0, c = imgBox.length; j < c; j++) {
  542. $(".big_img .swiper-wrapper").append('<div class="swiper-slide"><div class="cell"><img src="' + imgBox.eq(j).attr("src") + '" / ></div></div>');
  543. }
  544. mySwiper.updateSlidesSize();
  545. mySwiper.updatePagination();
  546. $(".big_img").css({
  547. "z-index": 1001,
  548. "opacity": "1"
  549. });
  550. mySwiper.slideTo(i, 0, false);
  551. return false;
  552. });
  553. $(".big_img").on("click",
  554. function () {
  555. $(this).css({
  556. "z-index": "-1",
  557. "opacity": "0"
  558. });
  559. });
  560. }