日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区

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

html - CSS3圖片滑動效果

瀏覽:235日期:2023-01-15 15:31:23

問題描述

需實現的效果如下

html - CSS3圖片滑動效果

<!DOCTYPE html><html lang='en'> <head><meta charset='UTF-8' /><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> <title>Sliding Image Panels with CSS3</title><meta name='viewport' content='width=device-width, initial-scale=1.0'> <meta name='description' content='Sliding Image Panels with CSS3' /><meta name='keywords' content='sliding, background-image, css3, panel, images, slider' /><meta name='author' content='Codrops' /><link rel='shortcut icon' href='http://m.b3g6.com/favicon.ico'> <link rel='stylesheet' type='text/css' href='http://m.b3g6.com/wenda/css/demo.css' /><link rel='stylesheet' type='text/css' href='http://m.b3g6.com/wenda/css/style1.css' /> </head> <body><p class='container'> <header><h1>Sliding Image Panels <span>with CSS3</span></h1><p class='codrops-demos'> <a href='http://m.b3g6.com/wenda/index.html'>Demo 1</a> <a href='http://m.b3g6.com/wenda/index2.html'>Demo 2</a> <a href='http://m.b3g6.com/wenda/index3.html'>Demo 3</a> <a href='http://m.b3g6.com/wenda/index4.html'>Demo 4</a></p> </header> <section class='cr-container'><input name='radio-set-1' type='radio' checked/><label for='select-img-1' class='cr-label-img-1'>1</label><input name='radio-set-1' type='radio' /><label for='select-img-2' class='cr-label-img-2'>2</label><input name='radio-set-1' type='radio' /><label for='select-img-3' class='cr-label-img-3'>3</label><input name='radio-set-1' type='radio' /><label for='select-img-4' class='cr-label-img-4'>4</label><p class='clr'></p> <p class='cr-bgimg'> <p><span></span><span></span><span></span><span></span> </p> <p><span></span><span></span><span></span><span></span> </p> <p><span></span><span></span><span></span><span></span> </p> <p><span></span><span></span><span></span><span></span> </p></p><p class='cr-titles'> <h3><span>Serendipity</span><span>What you’ve been dreaming of</span></h3> <h3><span>Adventure</span><span>Where the fun begins</span></h3> <h3><span>Nature</span><span>Unforgettable eperiences</span></h3> <h3><span>Serenity</span><span>When silence touches nature</span></h3></p> </section></p> </body></html>

下面這個是style1.css

.cr-container{ width: 600px; height: 400px; position: relative; margin: 0 auto; border: 20px solid #fff; box-shadow: 1px 1px 3px rgba(0,0,0,0.1);}.cr-container label{ font-style: italic; width: 150px; height: 30px; cursor: pointer; color: #fff; line-height: 32px; font-size: 24px; float:left; position: relative; margin-top:350px; z-index: 1000;}.cr-container label:before{ content:’’; width: 34px; height: 34px; background: rgba(130,195,217,0.9); position: absolute; left: 50%; margin-left: -17px; border-radius: 50%; box-shadow: 0px 0px 0px 4px rgba(255,255,255,0.3); z-index:-1;}.cr-container label:after{ width: 1px; height: 400px; content: ’’; background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,1))); background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); background: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); background: linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=’#00ffffff’, endColorstr=’#ffffff’,GradientType=0 ); position: absolute; bottom: -20px; right: 0px;}.cr-container label.cr-label-img-4:after{ width: 0px;}.cr-container input.cr-selector-img-1:checked ~ label.cr-label-img-1,.cr-container input.cr-selector-img-2:checked ~ label.cr-label-img-2,.cr-container input.cr-selector-img-3:checked ~ label.cr-label-img-3,.cr-container input.cr-selector-img-4:checked ~ label.cr-label-img-4{ color: #68abc2;}.cr-container input.cr-selector-img-1:checked ~ label.cr-label-img-1:before,.cr-container input.cr-selector-img-2:checked ~ label.cr-label-img-2:before,.cr-container input.cr-selector-img-3:checked ~ label.cr-label-img-3:before,.cr-container input.cr-selector-img-4:checked ~ label.cr-label-img-4:before{ background: #fff; box-shadow: 0px 0px 0px 4px rgba(104,171,194,0.6);}.cr-container input{ display: none;}.cr-bgimg{ width: 600px; height: 400px; position: absolute; left: 0px; top: 0px; z-index: 1;}.cr-bgimg{ background-repeat: no-repeat; background-position: 0 0;}.cr-bgimg p{ width: 150px; height: 400px; position: relative; float: left; overflow: hidden; background-repeat: no-repeat;}.cr-bgimg p span{ position: absolute; width: 150px; height: 400px; top: 0px; left: -150px; z-index: 2;}.cr-container input.cr-selector-img-1:checked ~ .cr-bgimg,.cr-bgimg p span:nth-child(1){ background-image: url(../images/1.jpg);}.cr-container input.cr-selector-img-2:checked ~ .cr-bgimg,.cr-bgimg p span:nth-child(2){ background-image: url(../images/2.jpg);}.cr-container input.cr-selector-img-3:checked ~ .cr-bgimg,.cr-bgimg p span:nth-child(3){ background-image: url(../images/3.jpg);}.cr-container input.cr-selector-img-4:checked ~ .cr-bgimg,.cr-bgimg p span:nth-child(4){ background-image: url(../images/4.jpg);}.cr-bgimg p:nth-child(1) span{ background-position: 0px 0px;}.cr-bgimg p:nth-child(2) span{ background-position: -150px 0px;}.cr-bgimg p:nth-child(3) span{ background-position: -300px 0px;}.cr-bgimg p:nth-child(4) span{ background-position: -450px 0px;}.cr-container input:checked ~ .cr-bgimg p span{ -webkit-animation: slideOut 0.6s ease-in-out; -moz-animation: slideOut 0.6s ease-in-out; -o-animation: slideOut 0.6s ease-in-out; -ms-animation: slideOut 0.6s ease-in-out; animation: slideOut 0.6s ease-in-out;}@-webkit-keyframes slideOut{ 0%{ left: 0px; } 100%{ left: 150px; }}@-moz-keyframes slideOut{ 0%{ left: 0px; } 100%{ left: 150px; }}@-o-keyframes slideOut{ 0%{ left: 0px; } 100%{ left: 150px; }}@-ms-keyframes slideOut{ 0%{ left: 0px; } 100%{ left: 150px; }}@keyframes slideOut{ 0%{ left: 0px; } 100%{ left: 150px; }}.cr-container input.cr-selector-img-1:checked ~ .cr-bgimg p span:nth-child(1),.cr-container input.cr-selector-img-2:checked ~ .cr-bgimg p span:nth-child(2),.cr-container input.cr-selector-img-3:checked ~ .cr-bgimg p span:nth-child(3),.cr-container input.cr-selector-img-4:checked ~ .cr-bgimg p span:nth-child(4){ -webkit-transition: left 0.5s ease-in-out; -moz-transition: left 0.5s ease-in-out; -o-transition: left 0.5s ease-in-out; -ms-transition: left 0.5s ease-in-out; transition: left 0.5s ease-in-out; -webkit-animation: none; -moz-animation: none; -o-animation: none; -ms-animation: none; animation: none; left: 0px; z-index: 10;}.cr-titles h3{ position: absolute; width: 100%; text-align: center; top: 50%; z-index: 10000; opacity: 0; color: #fff; text-shadow: 1px 1px 1px rgba(0,0,0,0.1); -webkit-transition: opacity 0.8s ease-in-out; -moz-transition: opacity 0.8s ease-in-out; -o-transition: opacity 0.8s ease-in-out; -ms-transition: opacity 0.8s ease-in-out; transition: opacity 0.8s ease-in-out;}.cr-titles h3 span:nth-child(1){ font-family: ’BebasNeueRegular’, ’Arial Narrow’, Arial, sans-serif; font-size: 70px; display: block; letter-spacing: 7px;}.cr-titles h3 span:nth-child(2){ letter-spacing: 0px; display: block; background: rgba(104,171,194,0.9); font-size: 14px; padding: 10px; font-style: italic; font-family: Cambria, Palatino, 'Palatino Linotype', 'Palatino LT STD', Georgia, serif;}.cr-container input.cr-selector-img-1:checked ~ .cr-titles h3:nth-child(1),.cr-container input.cr-selector-img-2:checked ~ .cr-titles h3:nth-child(2),.cr-container input.cr-selector-img-3:checked ~ .cr-titles h3:nth-child(3),.cr-container input.cr-selector-img-4:checked ~ .cr-titles h3:nth-child(4){ opacity: 1;}/* Media Query: Let’s show the inputs on mobile sized browsers because they probably don’t support the label trick: */@media screen and (max-width: 768px) { .cr-container input{display: inline;width: 24%;margin-top: 350px;z-index: 1000;position: relative; } .cr-container label{display: none; }}

如果按照上面的代碼,個人感覺CSS處理邏輯略微復雜、html結構也不夠清晰,不知道有沒有更好的的方法實現同樣的效果。

問題解答

回答1:

- -這就是4塊【無縫滾動】拼起來的。。需要注意的是獲取圖片數量時,只獲取每個區域下的,不要搞混淆。

寫了個簡單的例子,拿去參考下:

https://jsfiddle.net/hqojLLL4/1/

回答2:

把它當成4個單圖的幻燈片來做,做出一個就能出4個

回答3:

可以用background-position來分割圖片

標簽: HTML
相關文章:
日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区
久久免费影院| 国产亚洲高清视频| 日韩av中文在线观看| 免费在线视频一区| 日韩精品一卡二卡三卡四卡无卡| 国产精品日韩久久久| 免费日韩一区二区| 亚洲欧美日韩在线观看a三区| 国产精品毛片| 男女男精品视频网| 日本视频一区二区| 国产精品777777在线播放| 欧美国产三级| 精品视频一二| 成人看片网站| 日韩在线综合| 日韩午夜精品| 少妇高潮一区二区三区99| 日本成人中文字幕| 美女高潮久久久| 九九精品调教| 亚洲欧美日韩视频二区| 日韩手机在线| 美女性感视频久久| 精品成人免费一区二区在线播放| japanese国产精品| 蜜桃av一区二区| 久久国产精品色av免费看| 欧美极品中文字幕| 91看片一区| 亚洲免费一区二区| 国产日产一区| 日韩av有码| 亚洲精品中文字幕乱码| 中文字幕亚洲精品乱码| 久久午夜视频| 久久99影视| 蜜桃成人av| 日韩精品免费一区二区夜夜嗨| 久久精品国产一区二区| 欧美日韩国产传媒| 国产欧美日韩综合一区在线播放| av资源中文在线天堂| 亚洲色诱最新| 国产经典一区| 国产超碰精品| 亚洲精品美女91| 精品国产乱码久久久久久1区2匹| 九九综合在线| 国产精品密蕾丝视频下载| 成人日韩精品| 日韩欧美激情电影| 日韩一区自拍| 午夜性色一区二区三区免费视频| 久久久免费人体| 欧美中文字幕一区二区| 日韩和欧美一区二区三区| 麻豆网站免费在线观看| 一区二区三区四区精品视频| 麻豆理论在线观看| 最新国产精品| 日韩欧美另类一区二区| 日韩av在线播放中文字幕| 97精品国产福利一区二区三区| 久久国产88| 热三久草你在线| 美日韩精品视频| 久久精品1区| 国产伦理久久久久久妇女| 亚洲精品午夜av福利久久蜜桃| 另类小说一区二区三区| 亚洲精品在线二区| 久久网站免费观看| 久久精品国产一区二区| 婷婷久久免费视频| 日本免费一区二区三区四区| 成人看片网站| 久久99国产精品视频| 亚洲1区在线| 欧美成人亚洲| 亚洲永久av| 国产精品xxx| 最新亚洲国产| 91精品观看| 国产福利电影在线播放| 国产伦精品一区二区三区千人斩| 亚洲综合不卡| 99久久夜色精品国产亚洲1000部| 精品视频一区二区三区四区五区| 97成人在线| 黑丝一区二区| av资源中文在线天堂| 国产精品宾馆| 欧美日韩网址| 亚洲一区观看| 久久久久.com| 国产精品www.| 日本a口亚洲| 亚洲婷婷丁香| 欧美va天堂在线| 日韩免费在线| 97在线精品| av资源中文在线天堂| 美腿丝袜亚洲三区| 国产精品sss在线观看av| 蜜桃久久久久久| 在线日韩av| 中文字幕系列一区| 吉吉日韩欧美| 给我免费播放日韩视频| 美女尤物国产一区| 久久精品一区二区三区中文字幕| 国产九一精品| 国产伦一区二区三区| 国产午夜精品一区在线观看| 午夜久久av| 日韩欧美2区| 日本不卡一区二区三区| 亚洲一级淫片| 亚洲69av| 奇米777国产一区国产二区| 亚洲视频国产| 亚洲婷婷丁香| 日韩精品五月天| 91综合久久爱com| 日韩精品中文字幕一区二区| 日韩在线成人| 蜜臀av国产精品久久久久| 蜜桃一区二区三区在线观看| 免费高清在线一区| 在线精品福利| 91在线成人| 麻豆中文一区二区| аⅴ资源天堂资源库在线| 日韩三区在线| 91久久国产| 五月天久久网站| 免费欧美日韩| 日韩精品视频在线看| 国产精品午夜一区二区三区| 久久精品系列| 色天使综合视频| 欧美sss在线视频| 黄色亚洲免费| 日韩精品免费一区二区夜夜嗨| 欧美日韩一区二区三区四区在线观看| 国产欧美一区二区色老头| 久久精品国产999大香线蕉| 国产在线观看www| 久久一区二区三区电影| 国产精品美女| 日本不卡高清视频| 精品久久精品| 亚洲欧洲一区| 日本a级不卡| 精品成人18| 亚洲一级影院| 亚洲另类黄色| 麻豆精品蜜桃视频网站| 麻豆精品蜜桃| 蜜臀精品一区二区三区在线观看| 久久国产三级| 在线一区视频观看| 中文字幕成人| 国产一区二区三区精品在线观看| 午夜av不卡| 精品中文一区| 国产日韩欧美一区在线| 天堂√8在线中文| 久久亚洲图片| 欧美国产日本| 久久五月天小说| 日韩精品第一| 亚洲女同av| 亚洲综合婷婷| 高清精品久久| 亚洲涩涩av| 91免费精品| 视频在线在亚洲| 久久av资源| 午夜精品免费| 日本a级不卡| 日韩精品欧美| 青青国产精品| 激情自拍一区| 国产欧美日韩一区二区三区在线| 欧美日韩中文字幕一区二区三区| 日本一区二区三区视频在线看| 97在线精品| 88久久精品| 婷婷激情图片久久| 精品亚洲成人| 亚洲综合激情在线| 秋霞影视一区二区三区| 日本欧美大码aⅴ在线播放| 久久久久久美女精品| 综合亚洲色图| 欧美日韩国产在线观看网站| 久久久久久久久成人| 久色成人在线|