亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

老師你好 請求幫助 在選擇版本和顏色出錯 選擇第二個的時候默認選項顏色不恢復原來的顏色

瀏覽:88日期:2024-05-21 14:40:17

問題描述

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<link rel="stylesheet" href="static/css/detail.css" />

<link rel="stylesheet" href="static/css/layui.css" />

<link rel="stylesheet" href="static/css/style.css" />

<link rel="stylesheet" type="text/css" href="static/font-awesome/css/font-awesome.min.css">

<script type="text/javascript" src="static/js/layui.all.js" ></script>

<script type="text/javascript" src="static/js/jquery-3.3.1.min.js" ></script>

<script type="text/javascript" src="static/js/detail.js" ></script>

<title>紅米6A立即購買—小米商城</title>

<style>

*{padding: 0;margin: 0;list-style: none;text-decoration: none;}

/*頭*/

.header-lr{width:100%;height: 50px; box-shadow: 0px 10px 10px #ccc;margin-top: 10px;border-top: 2px solid #ccc;}

.header-lr-box{width: 1226px; height: 50px;margin:0 auto;}

.header-lefts li{width:70px;height: 50px;float: left;text-align: center;line-height: 50px;}

.header-lefts li a{color: #23262E;font-size: 14px;font-weight: none;}

.header-right{float: right;}

.header-right li{float: left; width: 70px;height: 50px;line-height: 50px;text-align: center;}

.header-right span{float: left;line-height: 50px; color: #aaa;font-size: 12px;}

.detail-img{width: 1226px;margin: 0 auto;}

.detail-img h6{font-size: 16px;font-weight: bold;margin: 10px auto;float: left;}

/*主要內容*/

.content-box{width: 1226px;margin: 30px auto;}

.content-box-left{width: 560px; height: 600px;float: left;}

.content-box-right{width: 600px;float: right;}

.content-box-right p{color: #aaa;margin: 10px auto;}

.content-box-map{width: 100%;height: 100px;background: /*rgba(51,51,51,0.2)*/#fafafa;margin: 20px auto;border: 1px solid #ccc;}

.content-box-map span{display: inline-block;margin-top: 10px;margin-left: 15px;}

.content-box-map i{position: relative;left: 12px;}

.content-box-money .rls{border: 1px solid #FF8200;}

.content-box-money div{width: 255px;height: 50px;text-align: center;float: left;border: 1px solid #ccc;line-height: 50px;padding: 0px 20px;}

.content-box-money span{float: right;color: #ccc;}

.content-box-money p{font-size: 18px;color: #333;margin: 15px 0px;}

.content-box-color p{font-size: 18px; color: #333; margin: 15px auto;}

.content-box-color div{width:255px ; height:50px ;float: left;padding:0px 20px;text-align: center;line-height: 50px;border:1px solid #ccc;}

.content-box-color span{display:inline-block;height: 16px;width: 16px;border-radius: 8px;margin-right: 10px;}

.content-bz-box0 p{float: left;font-size: 18px; color: #333;margin: 20px 0px;}

.content-bz-box0 a{float: right;font-size: 14px; margin: 20px 0px; color: #ff8200;}

.content-bz-box1{width: 598px;height: 150px;border: 1px solid #ccc;}

.content-bz-box1 span{float: left;width: 10px;height: 10px;line-height: 10px;border-radius: 6px;display: inline-block;margin: 60px auto;margin-left: 40px;}

.content-bz-box1 img{float: left;margin: 50px 20px;}

.content-bz-p{margin: 40px auto;}

.content-bz-p p{margin: 10px auto;}

.content-bz-p span{float: right;margin: 0px;margin-right:20px; color: #ccc;width: 50px;}

.content-bz-btn{color:rgba(0,0,0,0);border: 1px solid #ccc;}

.content-zs{width: 100%; height: 130px;background: #f9f9f9;margin-top: 30px;}

.content-zs div{margin: 0px 30px 20px;height: 50px; line-height: 30px; }

.content-zs p {float: left;}

.content-zs span{float: right;line-height: 50px;}

.content-box-color .rls{border: 1px solid #FF8200;}

.content-box-money,.content-box-color{width: 600px;}

.shop-che{width: 240px;height: 50px;text-align: center;line-height: 50px;background: #FF5722;color: #FFF; }

</style>

</head>

<body>

<div class="header">

<div class="menu">

<ul class="menu-left">

<li>

<a href="#">小米商城</a><span>|</span></li>

<li>

<a href="#">MIUI</a><span>|</span></li>

<li>

<a href="#">IOT</a><span>|</span></li>

<li>

<a href="#">云服務</a><span>|</span></li>

<li>

<a href="#">小愛分享平臺</a><span>|</span></li>

<li>

<a href="#">金融</a><span>|</span></li>

<li>

<a href="#">有品</a><span>|</span></li>

<li>

<a href="#">企業服務</a><span>|</span></li>

<li>

<a href="#">SelectRegion</a>

</li>

</ul>

<div class="menu-right">

<ul>

<li>

<a href="#">登錄</a><span>|</span></li>

<li>

<a href="#">注冊</a><span>|</span></li>

<li>

<a href="#">我的訂單</a>

</li>

<li class="menu-rshop">

<a><i class="fa fa-shopping-cart">&nbsp;&nbsp;購物車(0)</i></a>

<div>購物車中還沒有商品,趕緊選購吧!</div>

</li>

</ul>

</div>

</div>

</div>

<div class="contents" style="background: #F6F6F6;;">

<div class="content">

<div class="contentMenu">

<div class="contentMenu-imgbox">

<img src="static/images/footlogo.png" style="margin: 3px 5px;margin-right: 10px;" />

<img src="static/images/logoAD.gif" />

</div>

<!--下拉新品N-->

<ul class="contentMenu-ul">

<li>小米手機

<div class="mi-box">

<div class="mi-boxdiv">

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

</div>

</div>

</li>

<li>紅米

<div class="mi-box">

<div class="mi-boxdiv">

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

</div>

</div>

</li>

<li>電視</li>

<li>筆記本</li>

<li>盒子</li>

<li>新品</li>

<li>路由器

<div class="mi-box">

<div class="mi-boxdiv">

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

<div class="mi-box1">

<div class="mi-new">新品</div>

<div class="mi-shop">

<img src="static/images/phone/phone1.png" />

<br />

<a href="#">小米2s</a>

<br />

<a href="#" style=" color: #FF8200;">3299元</a>

</div>

</div>

<span></span>

</div>

</div>

</li>

<li>智能硬件</li>

<li>服務</li>

<li>社區</li>

</ul>

<div class="contentMenu-form">

<form action="">

<input type="text" />

<div class="contentMenu-intxt">

<a href="#">預熱618</a>

<a href="#">小米電視</a>

</div>

<div class="sousou-btn"><i class="fa fa-search"></i></div>

</form>

</div>

</div>

</div>

</div>

<div class="clear"></div>

<div class="header-lr">

<div class="header-lr-box">

<div class="header-lefts">

<ul>

<li>

<a>小米8</a>

</li>

<li>

<a>小米8se</a>

</li>

</ul>

</div>

<div class="header-right">

<ul>

<li>

<a>概述</a>

</li><span>|</span>

<li>

<a>圖集</a>

</li><span>|</span>

<li>

<a>參數</a>

</li><span>|</span>

<li>

<a>F碼通道</a>

</li><span>|</span>

<li>

<a>用戶評價</a>

</li>

</ul>

</div>

</div>

</div>

<div class="clear"></div>

<!--頭部分結束-->

<div class="content-box">

<div class="content-box-left">

<div class="layui-carousel" id="test1">

<div carousel-item>

<div><img src="static/images/lun/1.jpg"></div>

<div><img src="static/images/lun/2.jpg"></div>

<div><img src="static/images/lun/3.jpg"></div>

<div><img src="static/images/lun/4.jpg"></div>

</div>

</div>

</div>

<div class="content-box-right">

<h1>紅米6A</h1>

<p>12nm高性能處理器 / 5.45" 小巧全面屏 / 1300萬高清相機 / “小楊柳腰”機身</p>

<h2 style="color: #FF8200;border-bottom: 1px solid #aaa;height: 30px;">599</h2>

<div class="content-box-map">

<i class="fa fa-map-marker"></i>

<span>北京&nbsp;北京市&nbsp;東城區&nbsp;永定門外街道&nbsp;<a href="#" style="color: #FF8200;">修改</a></span><br />

<span><a href="#" style="color: #FF8200;margin-left: 12px;">有現貨</a></span>

</div>

<div class="content-box-money">

<p>選擇版本</p>

<div class="detail_much_left" style="margin-right: 5px;">4G+64G 全網通<span data-val="599">599</span></div>

<div class="detail_much_left">6G+64G 全網通<span data-val="699">699</span></div>

</div>

<div class="clear"></div>

<div class="content-box-color">

<p>選擇顏色</p>

<div class="content-color-left content-color-left-rls" style="margin-right: 5px;margin-bottom: 5px;"><span style="background:#F6E6D8; "></span>金色</div>

<div class="content-color-left"><span style="background:#3C3F43;"></span>深灰</div>

<div class="content-color-left" style="margin-right: 5px;"><span style="background:#D93239;"></span>亮紅</div>

<div class="content-color-left"><span style="background:#3871B7;"></span>亮藍</div>

</div>

<div class="clear"></div>

<div class="content-box-bz">

<div class="content-bz-box0">

<p>選擇小米提供的保障服務</p>

<a href="#">了解保障條款</a>

<div class="clear"></div>

</div>

<div class="content-bz-box1">

<span class="fa fa-check-circle content-bz-btn"></span>

<img src="static/images/bz.jpg">

<div class="content-bz-p">

<p style="font-size: 18px; color: #000;">意外保障服務</p>

<p>手機意外摔落/進水/碾壓等損壞</p>

<b class="fa fa-check-square content-bz-btn"></b> &nbsp;我已閱讀&nbsp;<a href="#">&nbsp;服務條款&nbsp;</a>|<a href="#">&nbsp;服務條款&nbsp;</a>

<span data-val="99">99元</span>

</div>

</div>

</div>

<!--2-->

<div class="clear"></div>

<div class="content-box-bz">

<div class="content-bz-box1">

<span class="fa fa-check-circle content-bz-btn"></span>

<img src="static/images/bz.jpg">

<div class="content-bz-p">

<p style="font-size: 18px; color: #000;">碎屏保障服務</p>

<p>手機意外碎屏</p>

<b class="fa fa-check-square content-bz-btn"></b> &nbsp;我已閱讀&nbsp;<a href="#">&nbsp;服務條款&nbsp;</a>|<a href="#">&nbsp;服務條款&nbsp;</a>

<span data-val="179">179元</span>

</div>

</div>

</div>

<div class="clear"></div>

<div class="content-zs">

<div><p>小米8 6GB+64GB 黑色</p><span id="mi-jg">699元</span></div>

<p id="tojg" style="color:#FF6A00;font-size: 25px;margin-left: 30px;">總計&nbsp;:&nbsp;699元</p>

</div>

<div class="shop-che">加入購物車</div>

<p><i class="fa fa-check-circle-o"></i>&nbsp;7天無理由退貨&nbsp;<i class="fa fa-check-circle-o"></i>&nbsp;15天質量問題換貨&nbsp;<i class="fa fa-check-circle-o"></i>&nbsp;365天保修</p>

</div>

</div>

<div class="clear"></div>

<!--說明-->

<div class="detail-img">

<h6>特別說明</h6>

<img src="static/images/sm.jpg" />

<h6>官方微信</h6>

<img src="static/images/2.jpg" />

</div>

<!--尾-->

<div class="footers">

<div class="footer">

<div class="for-li">

<a href="#"><i class="fa fa-wrench">&nbsp;預約維修服務</i><span>|</span></a>

<a href="#"><i class="fa fa-rotate-right">&nbsp;7天無理由退貨</i><span>|</span></a>

<a href="#"><i class="fa fa-refresh">&nbsp;15天免費換貨</i><span>|</span></a>

<a href="#"><i class="fa fa-gift">&nbsp;滿150元包郵</i><span>|</span></a>

<a href="#"><i class="fa fa-map-marker">&nbsp;520余家售后網點</i></a>

</div>

</div>

</div>

<div class="for-li-1">

<div class="for-li-a">

<dl>

<dt>幫助中心</dt>

<dd>

<a href="#">賬戶管理</a>

</dd>

<dd>

<a href="#">購物指南</a>

</dd>

<dd>

<a href="#">訂單操作</a>

</dd>

</dl>

<dl>

<dt>服務支持</dt>

<dd>

<a href="#">售后政策</a>

</dd>

<dd>

<a href="#">自助服務</a>

</dd>

<dd>

<a href="#">相關下載</a>

</dd>

</dl>

<dl>

<dt>線下門店</dt>

<dd>

<a href="#">小米之家</a>

</dd>

<dd>

<a href="#">服務網點</a>

</dd>

<dd>

<a href="#">授權體驗店</a>

</dd>

</dl>

<dl>

<dt>關于小米</dt>

<dd>

<a href="#">了解小米</a>

</dd>

<dd>

<a href="#">加入小米</a>

</dd>

<dd>

<a href="#">投資者關系</a>

</dd>

</dl>

<dl>

<dt>關注我們</dt>

<dd>

<a href="#">新浪微博</a>

</dd>

<dd>

<a href="#">官網微博</a>

</dd>

<dd>

<a href="#">聯系我們</a>

</dd>

</dl>

<dl>

<dt>特色服務</dt>

<dd>

<a href="#">F碼通道</a>

</dd>

<dd>

<a href="#">禮物碼</a>

</dd>

<dd>

<a href="#">防偽查詢</a>

</dd>

</dl>

<div class="for-conten">

<p class="suorg">Feir-520-1314</p>

<p class="suorg-1">周一至周日 8:00-18:00<br />(僅收市話費)</p>

<button class="btn"><span class="fa fa-commenting "></span> 聯系客服</button>

</div>

</div>

</div>

<div class="clear"></div>

<div class="for-end">

<div class="end-1" style="margin-right: 15px;"><img src="static/images/footlogo.png" alt="" /></div>

<div class="end-2">

<div class="endli">

<ul>

<li>小米商城<span></span></li>

<li>MIUI<span></span></li>

<li>米家<span></span></li>

<li>米聊<span></span></li>

<li>多看<span></span></li>

<li>游戲<span></span></li>

<li>路由器<span></span></li>

<li>米粉卡<span></span></li>

<li>政企服務<span></span></li>

<li>小米天貓店<span></span></li>

<li>隱私政策<span></span></li>

<li>問題反饋<span></span></li>

<li>Select Region</li>

</ul>

</div>

<div class="endli-p">

<a href="#">?mi.com</a>

京ICP證110507號

<a href="#">京ICP備10046444號</a>

<a href="#">京公網安備11010802020134號</a>

<a href="#">京網文[2014]0059-0009號</a>

</a>

<br> 違法和不良信息舉報電話:185-0130-1238,本網站所列數據,除特殊說明,所有數據均出自我司實驗室測試

</div>

</div>

<div class="end-3">

<img src="static/images/footericon1.png" alt="" class="icon" style="margin-right: 10px;" />

<img src="static/images/footericon2.png" alt="" class="icon" style="margin-right: 10px;" />

<img src="static/images/footericon3.png" alt="" class="icon" style="margin-right: 10px;" />

<img src="static/images/footericon4.png" alt="" class="icon" style="margin-right: 10px;" />

<img src="static/images/footericon5.png" alt="" class="icon" />

</div>

<div class="font">探索黑科技,小米為發燒而生! </div>

</div>

</body>

<script>

layui.use('carousel', function(){

var carousel = layui.carousel;

//建造實例

carousel.render({

elem: '#test1'

,width: '560px' //設置容器寬度

,height:'600px'

,arrow: 'always' //始終顯示箭頭

//,anim: 'updown' //切換動畫方式

});

});

</script>

<script>

//默認第一版本 替換class名方法

$(document).ready(function(){

//獲取class eq遍歷(0)從0開始(代表第一個)替換class名 為.content-box-bb rls

$(".detail_much_left").eq(0).attr("class",".detail_much_left rls")

$(".content-color-left").eq(0).attr("class",".content-color-left rls")

//點擊選中的版本

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

$(".detail_much_left").attr("class",".detail_much_left")

$(this).attr("class",".detail_much_left rls")

})

//點擊切換顏色

$(".content-color-left").click(function(){

$(".content-color-left").attr("class",".content-color-left")

$(this).attr("class",".content-color-left rls")

})

})

</script>

</html>

問題解答

回答1:

你的寫法問題,attr("class","class名前面不到帶點號");這是個很小的細節哦,要注意

回答2:

已解決

相關文章:
主站蜘蛛池模板: 亚洲精品久久 | 人成免费a级毛片 | 国产精品亚洲专区一区 | 在线观看免费国产视频 | 秀人网艾小青国产精品视频 | 亚洲欧美日韩精品中文乱码 | 久爱青草视频在线观看 | 五月婷婷网 | 免费看午夜高清性色生活片 | 激情免费网站 | 两性色午夜视频自由成熟的性 | 天天综合色一区二区三区 | 黑人一区二区三区 | 日韩精品久久久毛片一区二区 | 小明看片成人永久在线观看 | 成人国内精品久久久久影 | 日本xxxx韩国护士 | 日韩欧美亚洲另类 | 婷婷综合国产激情在线 | 久久久国产高清 | 大色综合| 一区二区三区视频在线播放 | 欧美性禁片在线观看 | 三级大黄 | 国产欧美日韩成人 | 久久国产视频一区 | 粉嫩00福利视频在线精品 | 拍真实国产伦偷精品 | 国产在播放一区 | 日本一区二区在线不卡 | 深夜福利国产精品亚洲尤物 | 欧美一a一片一级一片 | 青草青在线 | 日韩精品一区二区三区中文 | 国产欧美一区二区三区免费 | 国产精品免费小视频 | 在线观看国产一区二区三区 | 亚洲qingse中文字幕久久 | 国产精品柏欣彤在线观看 | 国产一国产a一级毛片 | 一级黄色片大全 |