亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

js不顯示

<!DOCTYPE html>
<html>
<head>
?<title>lianxi</title>
?<meta charset="utf-8">
?<link rel="stylesheet" type="text/css" href="fujian.css">
?<link rel="stylesheet" type="text/css" href="reset.css">
?<script src="scripts/fu.js"></script>
?


</head>
<body>

?<div id="shen">
?<img src="C:\Users\申津宇\Desktop\tu\shen.jpg" alt="108ok?" title="火影最棒!"><!--alt是圖片不加載顯示的內容,title是點擊圖片滑動的內容-->
?<img src="C:\Users\申津宇\Desktop\tu\shi.jpg" alt="109ok?" title="火影很好!">
?<img src="C:\Users\申津宇\Desktop\tu\wo.jpg" alt="110ok?" title="火影good!">
?</div>


</body>
</html>


#shen{
?height: 477px;
?margin: 0 auto;/*auto,(中間顯示)也是指的上下邊距為0,左右邊距自動適應寬度相等*/
?border-right: 1px solid purple;
?border-bottom: 1px solid purple;
?overflow: hidden;/*溢出的時候進行隱藏*/
?position: relative;
}

?#shen img {
?position: absolute;
?display: block;
?left: 0;
?border-left: 1px solid purple;


}




window.onload=function(){
?/*onload屬于DOM中,意識是頁面加載完畢。整句話的意思是,頁面加載完畢后,執行匿名函數的內容*/
var box=document.getElementById('shen')?;
var imgs=box.getElementsByTagName('img');
???
?? //通過標簽名來獲得當前網頁中的元素對象的,而且它返回的是一個數組,因為tag相同的元素可能不止一個這個時候就需要用getElementsByTagName("a")[0](返回第一個元素)來獲得對象的引用//

?? //下面定義單張圖片的實際寬度//
?? var imgwidth=img[0].offsetWidth;//offsetWidth是對象整體的實際寬度,就是除了外邊界的寬度,boder+padding+width//
?
?? //設置堆疊寬度//
?? var expose=160;

?? //設置容器的總寬度//
?? var boxwidth=imgwidth+(img.length-1)*expose;
?? box.style.width=boxwidth+'px';

??

?? for(var i=1,len=imgs.length;i<len;i++)? {
?? ?imgs[i].style.left=imgwidth+expose*(i-1)+"px"
?? }

??


};


正在回答

5 回答

你后面的js怎么不寫啊


0 回復 有任何疑惑可以回復我~
#1

qq_騎行夏威夷_1 提問者

非常感謝!
2018-06-25 回復 有任何疑惑可以回復我~


【蜘蛛俠TG@abin789】-12401
【蜘蛛俠TG@abin789】-12402
【蜘蛛俠TG@abin789】-12403
【蜘蛛俠TG@abin789】-12404
【蜘蛛俠TG@abin789】-12405
【蜘蛛俠TG@abin789】-12406
【蜘蛛俠TG@abin789】-12407
【蜘蛛俠TG@abin789】-12408
【蜘蛛俠TG@abin789】-12409
【蜘蛛俠TG@abin789】-12410
【蜘蛛俠TG@abin789】-12411
【蜘蛛俠TG@abin789】-12412
【蜘蛛俠TG@abin789】-12413
【蜘蛛俠TG@abin789】-12414
【蜘蛛俠TG@abin789】-12415
【蜘蛛俠TG@abin789】-12416
【蜘蛛俠TG@abin789】-12417
【蜘蛛俠TG@abin789】-12418
【蜘蛛俠TG@abin789】-12419
【蜘蛛俠TG@abin789】-12420
【蜘蛛俠TG@abin789】-12421
【蜘蛛俠TG@abin789】-12422
【蜘蛛俠TG@abin789】-12423
【蜘蛛俠TG@abin789】-12424
【蜘蛛俠TG@abin789】-12425
【蜘蛛俠TG@abin789】-12426
【蜘蛛俠TG@abin789】-12427
【蜘蛛俠TG@abin789】-12428
【蜘蛛俠TG@abin789】-12429
【蜘蛛俠TG@abin789】-12430
【蜘蛛俠TG@abin789】-12431
【蜘蛛俠TG@abin789】-12432
【蜘蛛俠TG@abin789】-12433
【蜘蛛俠TG@abin789】-12434
【蜘蛛俠TG@abin789】-12435
【蜘蛛俠TG@abin789】-12436
【蜘蛛俠TG@abin789】-12437
【蜘蛛俠TG@abin789】-12438
【蜘蛛俠TG@abin789】-12439
【蜘蛛俠TG@abin789】-12440
【蜘蛛俠TG@abin789】-12441
【蜘蛛俠TG@abin789】-12442
【蜘蛛俠TG@abin789】-12443
【蜘蛛俠TG@abin789】-12444
【蜘蛛俠TG@abin789】-12445
【蜘蛛俠TG@abin789】-12446
【蜘蛛俠TG@abin789】-12447
【蜘蛛俠TG@abin789】-12448
【蜘蛛俠TG@abin789】-12449
【蜘蛛俠TG@abin789】-12450
【蜘蛛俠TG@abin789】-12451
【蜘蛛俠TG@abin789】-12452
【蜘蛛俠TG@abin789】-12453
【蜘蛛俠TG@abin789】-12454
【蜘蛛俠TG@abin789】-12455
【蜘蛛俠TG@abin789】-12456
【蜘蛛俠TG@abin789】-12457
【蜘蛛俠TG@abin789】-12458
【蜘蛛俠TG@abin789】-12459
【蜘蛛俠TG@abin789】-12460
【蜘蛛俠TG@abin789】-12461
【蜘蛛俠TG@abin789】-12462
【蜘蛛俠TG@abin789】-12463
【蜘蛛俠TG@abin789】-12464
【蜘蛛俠TG@abin789】-12465
【蜘蛛俠TG@abin789】-12466
【蜘蛛俠TG@abin789】-12467
【蜘蛛俠TG@abin789】-12468
【蜘蛛俠TG@abin789】-12469
【蜘蛛俠TG@abin789】-12470
【蜘蛛俠TG@abin789】-12471
【蜘蛛俠TG@abin789】-12472
【蜘蛛俠TG@abin789】-12473
【蜘蛛俠TG@abin789】-12474
【蜘蛛俠TG@abin789】-12475
【蜘蛛俠TG@abin789】-12476
【蜘蛛俠TG@abin789】-12477
【蜘蛛俠TG@abin789】-12478
【蜘蛛俠TG@abin789】-12479
【蜘蛛俠TG@abin789】-12480
【蜘蛛俠TG@abin789】-12481
【蜘蛛俠TG@abin789】-12482
【蜘蛛俠TG@abin789】-12483
【蜘蛛俠TG@abin789】-12484
【蜘蛛俠TG@abin789】-12485
【蜘蛛俠TG@abin789】-12486
【蜘蛛俠TG@abin789】-12487
【蜘蛛俠TG@abin789】-12488
【蜘蛛俠TG@abin789】-12489
【蜘蛛俠TG@abin789】-12490
【蜘蛛俠TG@abin789】-12491
【蜘蛛俠TG@abin789】-12492
【蜘蛛俠TG@abin789】-12493
【蜘蛛俠TG@abin789】-12494
【蜘蛛俠TG@abin789】-12495
【蜘蛛俠TG@abin789】-12496
【蜘蛛俠TG@abin789】-12497
【蜘蛛俠TG@abin789】-12498
【蜘蛛俠TG@abin789】-12499
【蜘蛛俠TG@abin789】-12500
【蜘蛛俠TG@abin789】-12501
【蜘蛛俠TG@abin789】-12502
【蜘蛛俠TG@abin789】-12503
【蜘蛛俠TG@abin789】-12504
【蜘蛛俠TG@abin789】-12505
【蜘蛛俠TG@abin789】-12506
【蜘蛛俠TG@abin789】-12507
【蜘蛛俠TG@abin789】-12508
【蜘蛛俠TG@abin789】-12509
【蜘蛛俠TG@abin789】-12510
【蜘蛛俠TG@abin789】-12511
【蜘蛛俠TG@abin789】-12512
【蜘蛛俠TG@abin789】-12513
【蜘蛛俠TG@abin789】-12514
【蜘蛛俠TG@abin789】-12515
【蜘蛛俠TG@abin789】-12516
【蜘蛛俠TG@abin789】-12517
【蜘蛛俠TG@abin789】-12518
【蜘蛛俠TG@abin789】-12519
【蜘蛛俠TG@abin789】-12520
【蜘蛛俠TG@abin789】-12521
【蜘蛛俠TG@abin789】-12522
【蜘蛛俠TG@abin789】-12523
【蜘蛛俠TG@abin789】-12524
【蜘蛛俠TG@abin789】-12525
【蜘蛛俠TG@abin789】-12526
【蜘蛛俠TG@abin789】-12527
【蜘蛛俠TG@abin789】-12528
【蜘蛛俠TG@abin789】-12529
【蜘蛛俠TG@abin789】-12530
【蜘蛛俠TG@abin789】-12531
【蜘蛛俠TG@abin789】-12532
【蜘蛛俠TG@abin789】-12533
【蜘蛛俠TG@abin789】-12534
【蜘蛛俠TG@abin789】-12535
【蜘蛛俠TG@abin789】-12536
【蜘蛛俠TG@abin789】-12537
【蜘蛛俠TG@abin789】-12538
【蜘蛛俠TG@abin789】-12539
【蜘蛛俠TG@abin789】-12540
【蜘蛛俠TG@abin789】-12541
【蜘蛛俠TG@abin789】-12542
【蜘蛛俠TG@abin789】-12543
【蜘蛛俠TG@abin789】-12544
【蜘蛛俠TG@abin789】-12545
【蜘蛛俠TG@abin789】-12546
【蜘蛛俠TG@abin789】-12547
【蜘蛛俠TG@abin789】-12548
【蜘蛛俠TG@abin789】-12549
【蜘蛛俠TG@abin789】-12550
【蜘蛛俠TG@abin789】-12551
【蜘蛛俠TG@abin789】-12552
【蜘蛛俠TG@abin789】-12553
【蜘蛛俠TG@abin789】-12554
【蜘蛛俠TG@abin789】-12555
【蜘蛛俠TG@abin789】-12556
【蜘蛛俠TG@abin789】-12557
【蜘蛛俠TG@abin789】-12558
【蜘蛛俠TG@abin789】-12559
【蜘蛛俠TG@abin789】-12560
【蜘蛛俠TG@abin789】-12561
【蜘蛛俠TG@abin789】-12562
【蜘蛛俠TG@abin789】-12563
【蜘蛛俠TG@abin789】-12564
【蜘蛛俠TG@abin789】-12565
【蜘蛛俠TG@abin789】-12566
【蜘蛛俠TG@abin789】-12567
【蜘蛛俠TG@abin789】-12568
【蜘蛛俠TG@abin789】-12569
【蜘蛛俠TG@abin789】-12570
【蜘蛛俠TG@abin789】-12571
【蜘蛛俠TG@abin789】-12572
【蜘蛛俠TG@abin789】-12573
【蜘蛛俠TG@abin789】-12574
【蜘蛛俠TG@abin789】-12575
【蜘蛛俠TG@abin789】-12576
【蜘蛛俠TG@abin789】-12577
【蜘蛛俠TG@abin789】-12578
【蜘蛛俠TG@abin789】-12579
【蜘蛛俠TG@abin789】-12580
【蜘蛛俠TG@abin789】-12581
【蜘蛛俠TG@abin789】-12582
【蜘蛛俠TG@abin789】-12583
【蜘蛛俠TG@abin789】-12584
【蜘蛛俠TG@abin789】-12585
【蜘蛛俠TG@abin789】-12586
【蜘蛛俠TG@abin789】-12587
【蜘蛛俠TG@abin789】-12588
【蜘蛛俠TG@abin789】-12589
【蜘蛛俠TG@abin789】-12590
【蜘蛛俠TG@abin789】-12591
【蜘蛛俠TG@abin789】-12592
【蜘蛛俠TG@abin789】-12593
【蜘蛛俠TG@abin789】-12594
【蜘蛛俠TG@abin789】-12595
【蜘蛛俠TG@abin789】-12596
【蜘蛛俠TG@abin789】-12597
【蜘蛛俠TG@abin789】-12598
【蜘蛛俠TG@abin789】-12599
【蜘蛛俠TG@abin789】-12600

0 回復 有任何疑惑可以回復我~

改一下就出來了


0 回復 有任何疑惑可以回復我~

還有設置容器總寬度也是imgs.length 你寫成了img

0 回復 有任何疑惑可以回復我~

定義單張圖片實際寬度 是imgs 你寫的img

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號