第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么在這上面運行沒效果,自己寫的運行只顯示頁面1

<!DOCTYPE html>
<html>

<head>
??? <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
??? <title>慕課七夕主題</title>
??? <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
??? <style type="text/css">
??? * {
??????? padding: 0;
??????? margin: 0;
??? }

??? ul,
??? li {
??????? list-style-type: none;
??? }
??? /*主體部分*/
??? #content {
??????? width??? : 60%;
??????? height?? : 60%;
??????? top????? : 20%;
??????? left???? : 20%;
??????? overflow : hidden;
??????? position : absolute;
??????? border?? : 1px solid #ccc;
??? }
?? ?
??? .content-wrap {
??????? position: relative;
??? }
??? .content-wrap > li {
??????? width: 100%;
??????? height: 100%;
??????? background: #CAE1FF;
??????? color: red;
??????? float: left;
??????? overflow: hidden;
??????? position: relative;
??? }
??? li:nth-child(2) {
?????? background: #9BCD9B;
??? }
? ?
??? li:nth-child(3) {
?????? background: yellow;
??? }
?? ?
??? </style>
</head>

<body>
??? <div id='content'>
??????? <ul class='content-wrap'>
??????????? <!-- 第一副畫面 -->
??????????? <li> 頁面1 </li>
??????????? <!-- 第二副畫面 -->
??????????? <li> 頁面2 </li>
??????????? <!-- 第三副畫面 -->
??????????? <li> 頁面3 </li>
??????? </ul>
??? </div>
??? <script type="text/javascript">
??????? var container = $("#content");
??????? // 獲取第一個子節(jié)點
??????? var element = container.find(":first");
??????? // li頁面數(shù)量
??????? var slides = element.find("li");
??????? // 獲取容器尺寸
??????? var width = container.width();
??????? var height = container.height();
??????? // 設(shè)置li頁面總寬度
??????? element.css({
??????????? width? : (slides.length * width) + 'px',
??????????? height : height + 'px'
??????? });
??????? // 設(shè)置每一個頁面li的寬度
??????? $.each(slides, function(index) {
??????????? var slide = slides.eq(index); //獲取到每一個li元素?? ?
??????????? slide.css({
??????????????? width:width+'px',
??????????????? height:height+'px'
??????????? });
??????? });
??? </script>
</body>

</html>

正在回答

0 回答

運行起來就是只顯示頁面1哇,#content的寬度與? .content-wrap > li的寬度相等。.content的寬度等于三個li寬度之和。#content,overflow:hidden。其余兩個li,hidden了。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么在這上面運行沒效果,自己寫的運行只顯示頁面1

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號