<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>华为智能门锁</title>
		<link rel="stylesheet" href="css/main.css">
		<style>
		</style>
		<script src="js/jQuery.js"></script>
		<script type="text/javascript">
			  $(function() {
			      $("#count_add").click(function() {
			          var index = $("#product_count").val();
			          index++;
			          if (index >= 10) {
			              index = 10;
			          }
			          $("#product_count").val(index);
			      });
			      $("#count_minus").click(function() {
			          var index = $("#product_count").val();
			          index--;
			          if (index <= 0) {
			              index = 1;
			          }
			          $("#product_count").val(index);
			      });
<pre><code>		      var data = [{
		              &quot;name&quot;: &quot;星际黑&quot;,
		              &quot;version&quot;: [{
		                      &quot;name&quot;: &quot;Pro 版 3D人脸识别+可视猫眼+指纹解锁&quot;,
		                      &quot;price&quot;: 3699,
		                  },
		                  {
		                      &quot;name&quot;: &quot;标准版 可视猫眼+指纹解锁&quot;,
		                      &quot;price&quot;: 2499
		                  },
		              ],
		              &quot;images&quot;: [&quot;a01.png&quot;, &quot;a02.png&quot;, &quot;a03.png&quot;, &quot;a04.png&quot;, &quot;a05.png&quot;, &quot;a06.png&quot;, &quot;a07.png&quot;,
		                  &quot;a08.png&quot;, &quot;a09.png&quot;, &quot;a10.png&quot;, &quot;a11.png&quot;, &quot;a12.png&quot;
		              ]
		          },
		          {
		              &quot;name&quot;: &quot;鎏光金&quot;,
		              &quot;version&quot;: [{
		                      &quot;name&quot;: &quot;Pro 版 3D人脸识别+可视猫眼+指纹解锁&quot;,
		                      &quot;price&quot;: 3999
		                  },
		                  {
		                      &quot;name&quot;: &quot;标准版 可视猫眼+指纹解锁&quot;,
		                      &quot;price&quot;: 2799
		                  }
		              ],
		              &quot;images&quot;: [&quot;b01.png&quot;, &quot;b02.png&quot;, &quot;b03.png&quot;, &quot;b04.png&quot;, &quot;b05.png&quot;, &quot;b06.png&quot;, &quot;b07.png&quot;,
		                  &quot;b08.png&quot;
		              ]
		          }
		      ];
		      $(&quot;div[class='item gold selected']&quot;).removeClass(&quot;selected&quot;);
		      $(&quot;div[class='item black']&quot;).addClass(&quot;selected&quot;);
		  
		      $(&quot;#scroll ul&quot;).html(&quot;&quot;);
		  
		      var blackimgs = data[0].images;
		      $.each(blackimgs, function(i, v) {
		          $(&quot;#scroll ul&quot;).append(`&lt;li&gt;&lt;img src=&quot;img/${v}&quot; alt=&quot;&quot;&gt;&lt;/li&gt;`);
		      });
		  
		      $(&quot;div[class='photo']&quot;).find(&quot;img&quot;).attr(&quot;src&quot;, &quot;img/&quot; + blackimgs[0]);
		  
		      var colorIndex = 0;
		      var divs = $(&quot;#color_panel .choose&quot;).find(&quot;div&quot;);
		      $(divs).click(function() {
		          $(this).siblings().removeClass(&quot;selected&quot;);
		          $(this).addClass(&quot;selected&quot;);
		  
		          colorIndex = $(this).index();
		          var blackimgs = data[colorIndex].images;
		  
		          $(&quot;#scroll ul&quot;).html(&quot;&quot;);
		          $.each(blackimgs, function(i, v) {
		              $(&quot;#scroll ul&quot;).append(`&lt;li&gt;&lt;img src=&quot;img/${v}&quot; alt=&quot;&quot;&gt;&lt;/li&gt;`);
		          });
		  
		          $(&quot;div[class='photo']&quot;).find(&quot;img&quot;).attr(&quot;src&quot;, &quot;img/&quot; + blackimgs[0]);
		  
		          var obj = data[colorIndex];
		          var versionIndex = $(&quot;#version_panel .choose&quot;).find(&quot;div.selected&quot;).index();
		          $(&quot;#property_pannel .price&quot;).find(&quot;span&quot;).html(obj.version[versionIndex].price);
		      });
		  
		      var versionIndex = 0;
		      var divs = $(&quot;#version_panel .choose&quot;).find(&quot;div&quot;);
		      $(divs).click(function() {
		          $(this).siblings().removeClass(&quot;selected&quot;);
		          $(this).addClass(&quot;selected&quot;);
		  
		          $(&quot;#property_pannel&quot;).children(&quot;div:first-child&quot;).html($(this).html());
		          versionIndex = $(this).index();
		          var obj = data[colorIndex];
		          $(&quot;#property_pannel .price&quot;).find(&quot;span&quot;).html(obj.version[versionIndex].price);
		      });
		  
		      var page = 1;
		      var i = 5.35;
		      $(&quot;div[class='next tab']&quot;).on('click', function() {
		          var show = $(&quot;.photo_list ul&quot;);
		          var width = show.find(&quot;img&quot;).width() * i;
		          var len = show.find(&quot;li&quot;).length;
		          console.log(len);
		          var page_count = Math.ceil(len / i);
		          if (!show.is(&quot;:animated&quot;)) {
		              if (page == page_count) {
		                  show.animate({
		                      left: '0px'
		                  }, &quot;show&quot;);
		                  page = 1;
		              } else {
		                  show.animate({
		                      left: '-=' + width
		                  }, &quot;show&quot;);
		                  page++;
		              }
		          }
		      });
		  
		      $(&quot;#scroll img&quot;).on('click', function() {
		          var imgpath = $(this).attr(&quot;src&quot;);
		          $(&quot;div[class='photo']&quot;).find(&quot;img&quot;).attr(&quot;src&quot;, imgpath);
		      });
		  
		  });
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;nav_panel&quot;&gt;
		&lt;div class=&quot;nav&quot;&gt;&lt;img src=&quot;img/top.png&quot; alt=&quot;&quot;&gt;&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;position&quot;&gt;
		&lt;a href=&quot;&quot; title=&quot;首页&quot;&gt;首页&lt;/a&gt;
		&amp;gt;
		&lt;a href=&quot;&quot; title=&quot;智能家装&quot;&gt;智能家装&lt;/a&gt;
		&amp;gt;
		&lt;a href=&quot;&quot; title=&quot;智能门锁&quot;&gt;智能门锁&lt;/a&gt;
		&amp;gt;
		&lt;a id=&quot;product_title&quot; href=&quot;&quot; title=&quot;智能门锁 标准版&quot;&gt;智能门锁 标准版&lt;/a&gt;			
	&lt;/div&gt;
	&lt;div class=&quot;main&quot;&gt;
		&lt;div id=&quot;photo_pannel&quot;&gt;
			&lt;div class=&quot;photo&quot;&gt;&lt;img src=&quot;img/a01.png&quot; alt=&quot;&quot;&gt;&lt;/div&gt;
			&lt;div class=&quot;photo_list&quot;&gt;
				&lt;div class=&quot;prev tab&quot;&gt;&lt;img src=&quot;img/disabled-prev.png&quot; alt=&quot;&quot;&gt;&lt;/div&gt;
				&lt;div id=&quot;scroll&quot;&gt;
					&lt;ul&gt;
						&lt;li&gt;&lt;img src=&quot;img/a01.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a02.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a03.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a04.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a05.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a06.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a07.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a08.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a09.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a10.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a11.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
						&lt;li&gt;&lt;img src=&quot;img/a12.png&quot; alt=&quot;&quot;&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
				&lt;div class=&quot;next tab&quot;&gt;&lt;img src=&quot;img/hover-next.png&quot; alt=&quot;&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;div id=&quot;property_pannel&quot;&gt;
			&lt;div class=&quot;title&quot;&gt;华为智能门锁 标准版&lt;/div&gt;
			&lt;div class=&quot;desc&quot;&gt;AI指纹锁,华为手机钱包钥匙开锁,HarmonyOS分布式猫眼,8800mAh超大容量电池&lt;/div&gt;
			&lt;div class=&quot;price&quot;&gt;¥&lt;span&gt;2799&lt;/span&gt;&lt;/div&gt;
			&lt;div class=&quot;hot&quot;&gt;智能门锁系列:&lt;span&gt;拼团最高省500&lt;/span&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;/div&gt;
			&lt;div class=&quot;color choose_outer&quot; id=&quot;color_panel&quot;&gt;
				&lt;div class=&quot;title&quot;&gt;颜色&lt;/div&gt;
				&lt;div class=&quot;choose&quot;&gt;
					&lt;div class=&quot;item black&quot;&gt;星际黑&lt;/div&gt;
					&lt;div class=&quot;item gold selected&quot;&gt;鎏光金&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
			&lt;div class=&quot;type choose_outer&quot; id=&quot;version_panel&quot;&gt;
				&lt;div class=&quot;title&quot;&gt;版本&lt;/div&gt;
				&lt;div class=&quot;choose&quot;&gt;
					&lt;div class=&quot;item&quot;&gt;Pro 版&lt;br&gt;&lt;/比如&gt;3D人脸识别+可视猫眼+指纹解锁&lt;/div&gt;
					&lt;div class=&quot;item&quot;&gt;标准版&lt;br&gt;可视猫眼+指纹解锁&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
			&lt;div class=&quot;service choose_outer&quot;&gt;
				&lt;div class=&quot;title&quot;&gt;保障服务&lt;/div&gt;
				&lt;div class=&quot;desc&quot;&gt;已有590万位用户加入华为官方保障服务&lt;/div&gt;
			&lt;/div&gt;
			&lt;div id=&quot;order_panel&quot;&gt;
				&lt;div class=&quot;count&quot;&gt;&lt;div class=&quot;count_op&quot; id=&quot;count_minus&quot;&gt;&lt;img src=&quot;img/minus.png&quot; alt=&quot;&quot;&gt;&lt;/div&gt;&lt;input type=&quot;text&quot; name=&quot;&quot; id=&quot;product_count&quot; value=&quot;1&quot;&gt;&lt;div class=&quot;count_op&quot; id=&quot;count_add&quot;&gt;&lt;img src=&quot;img/add.png&quot; alt=&quot;&quot;&gt;&lt;/div&gt;&lt;/div&gt;
				&lt;button class=&quot;add&quot;&gt;加入购物车&lt;/button&gt;
				&lt;button class=&quot;buy&quot;&gt;立刻购买&lt;/button&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/body&gt;
</code></pre>
</html>

原文地址: http://www.cveoy.top/t/topic/pFnh 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录