(1) 背景来自jq22:http://www.jq22.com/demo/html5bg20151116/
(2) 动画来自:https://segmentfault.com/a/1190000003721884
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
| <template> <div class="body"> <div class="page"> <div class="page_box"> <ul class="box item1"> <li>li> ul> <ul class="box item2"> <li>li> ul> div> <div class="title">背景无缝左右滚动div> div> div> template> <style lang="less" scoped>
@keyframes moveup { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.page { margin-top: 200px; height: 100vh; overflow: hidden; position: relative; .title { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); font-size: 48px; color: rgba(255, 255, 255, 0.8); font-weight: 600; } .page_box { width: 200vw; .box { animation: moveup 20s linear infinite; margin: 0; display: inline-block; float: left; li { background: url(https://pic.downk.cc/item/5e6af516e83c3a1e3a620715.jpg) no-repeat center center; width: 100vw; height: 100vh; background-size: cover; list-style: none; } } } } style>
|