Blame view

frontend/web/js/main.js 1.5 KB
4253cbec   root   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
  /* more_hide */

  $(function(){

  	$(".more").click(function(){

  		if($(this).hasClass("hideico")){

  			$(this).removeClass("hideico");

  			$(this).parent().addClass("open");

  		$(this).parent().removeClass("open");

  		}

  		else{

  		$(this).addClass("hideico");

  			$(this).parent().addClass("open");

  		}

  	})

  });

  

  $(function(){

  	$(".minus").click(function(){

  		var a = $(this).parent().find(".item_num").attr("value");

  		if (a == 1) {

  		/* минимум 1 элемент */

  		}

  		else{

  		a--;

  		$(this).parent().find('.item_num').val(a);

  		}

  	});

  	$(".plus").click(function(){

  		var a = $(this).parent().find(".item_num").attr("value");

  		if (a == 10) {

  		/* минимум 1 элемент */

  		}

  		else{

  		a++;

  		$(this).parent().find('.item_num').val(a);

  		}

  	});

  })

  

  $(function(){

  	$(".black_close").click(function(){

  		$(this).parent().parent().addClass("hidden");

  	})

  	$(".tobasket").click(function(){

  		$(".black").removeClass("hidden");

  	});

  	$(".cont_shop").click(function(){

  		$(".black").addClass("hidden");

  	})

  })

  

  $(function(){

  	$(".variant").click(function(){

  		$(this).parent().find(".active").removeClass("active");

  		$(this).addClass("active");

  	})

  })

  

  

  $(function(){

  	$(".title_spoiler").click(function(){

  		if($(this).hasClass("closed")){

  		$(this).parent().find(".spoiler_content").removeClass("hidden");

  		$(this).removeClass("closed");

  		}

  		else{

  		$(this).parent().find(".spoiler_content").addClass("hidden");

  		$(this).addClass("closed");

  		}

  	});

  })