/*外边框div */
#wbkdiv1{width:1000px;padding:32px;position:relative;margin:0px auto; left :-20px; background-image:url(https://z3.ax1x.com/2021/07/29/Wq27Xq.jpg); }
/*视窗div */
#scdiv1{width:1000px;height:896px;overflow:hidden;position:relative;}
/*装所有图片(每张间隔5px)的div,88+2张图片(为了连接性好,后面重复放前两张)总宽度605*90=54450,height:896px;每张图片的高度*/
#picdiv1{width:54450px; height:896px; animation:picMove 450s linear infinite; animation-delay:2s; position:relative; right:210px;}
/* 动画定义-从左向右平移 */
@keyframes picMove{
0%{left:-53450px;} /* 起始位置= - */
100%{left:-210px;} /*结束位置= - */
}
/* 鼠标放到视窗上时暂停移动,现不用它。 */
/* #picdiv1:hover{animation-play-state: paused;}*/
/*img元素的样式。float: right 表示图片从右向左排放,mask蒙板*/
#picdiv1 > img {float: right;height:896px;width:600px;margin-right:5px; -webkit-mask-image:radial-gradient(black 50%, transparent 87%); -webkit-mask-size: cover;}
</style>
<div id="wbkdiv1">
<div id="scdiv1">
<div id="picdiv1" >
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512145956d4a6e08f8727.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512140037a6024645ae88.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512143bc1a2f6ad6bb514.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151214c046b87ad48e7c0d.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151214db8f57e4f75ea0d1.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512155b5f3447c864751e.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512156321f05bad5addf6.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512159bf7206017bd2cfa.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512158627f53bcc266c3b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512154b2a21b5c8ee6e46.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151215dac888da31f9ed77.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512159c97da2fdecbd9e5.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512166e34cdd78807e1e9.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512161042a1ce3ca53730.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151216edd6bcac094d9a28.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512177974d2c630205917.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512176eeb6901a7fb9d97.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151217cdade761b60b9618.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151217f277aee932f2e884.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512164b0ec04846cb279a.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151218f154b8f70145b553.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415121853c85437748ba23d.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151218b07609b26d53ced6.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512186fef86590a752d85.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415121826e8f034ca4514d5.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151218a03d35e880dc0179.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415121856fa7a15a77ecdb1.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151218f28364de146a05f7.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415121897d51ac4938353b3.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151218ea07aa62d558e1d0.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151219e0027ac0733c9d78.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415121924287f10e19983ce.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151219de79cc9221187407.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151219adf45e0dce10a473.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512190b23cfdf8c63ca04.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151220f41d547984fd2b69.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512203c0db2a00a47c61c.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122098b44c45115d3a3c.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151220e6afbc4756d0c9bf.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151219a004e5e8cafdb2a6.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122195778bda5cce95b6.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122109b431518d2d5237.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122163d6cb0cd72a8ea3.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122102c43f62595cfa66.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122108873d84d51e0ac4.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151221efcd2c45d39f0eb8.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151221050d17c23fd496a6.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122154bca87e45a6562f.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151221e8f742407950c846.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512217a76984866b5f2e9.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512241214793dc4cf6f35.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122497953948521d9ccf.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151224259d5d17ee59252b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512249b20ebe85d485008.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151224f671651c672b8cf8.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151224f7beaca0f20ac166.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512241c49ca961dee924b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151224fb5423b3491b87d4.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512245086bd796b26d3d3.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122491b10341a1cef957.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151225a208cb71b9d16601.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151226cbd5bdb1da5f0727.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151226962c8ccfa778e471.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512263b8c389b16c14d0b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151226a8c75cd013592c79.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512263eae3faf3d9b579b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151226c74ba21b09ab0efd.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151226059d673655713f6b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151226692c9dda17df602c.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122558280e4b499a81f8.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122780cf920a12d91461.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122762e0db7c07ded419.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151227daeda1fd2ceceb34.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512277138f9d12095ce0d.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122716f5911c8418328a.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151227fe9259bb36ef79b4.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151228fb247bcd3c9ad29a.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512280b9cc87628c0c87b.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512288c1da94ac37ec3e3.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151227abc2fd301abb0d59.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122927c394f0ce1ff93a.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122931f11cf760654727.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/090415122984fd4de0768cdd8f.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151229039ac02abb635487.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151229fc55d0dcf2a6e1cc.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512296924bd9745806ab1.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151229fc3870745f0f56b4.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/0904151229bbbb04ebd85761a3.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512145956d4a6e08f8727.jpg">
<imgsrc="http://bbs.foz.cn/data/attachment/forum/forumid_20/09041512140037a6024645ae88.jpg">
</div></div></div>
本帖最后由 寒冬残荷 于 2021-7-30 10:04 编辑
这个是向右移动,上一个是向左移动。但两个图片移动顺序都是从小到大的。 本帖最后由 195400 于 2021-7-30 22:58 编辑 <br /><br />寒冬残荷 发表于 2021-7-30 10:02
这个是向右移动,上一个是向左移动。但两个图片移动顺序都是从小到大的。
1楼改成了向左移动,把left <---> right 互换一下就行了。
<style type="text/css">
.鼻烟壶{
width:340px;height:390px;float:left;overflow:hidden;background-position-x :0px; margin:24px 0px;
background:url(http://tpic.home.news.cn/xhBlog/xhpic001/M02/E4/E0/wKhTg1cBtJoEAAAAAAAAAAAAAAA648.png);
}
#pichold{
width:14960px;/* 41*340 = 13940 , 44*340=14960 */
height:450px;
background-image:url(https://z3.ax1x.com/2021/07/29/WqsPnU.jpg);
position:absolute;
animation: picMoveRight 75s linear infinite;
}
#slideframe {
width:1000px;
height:450px;
overflow:hidden;
position:relative;
}
#pichold:hover {
animation-play-state: paused;
}
@keyframes picMoveRight {
from {right:0px;}
to {right:-13940px;}
}
@keyframes picMoveLeft {
from {left:0px;}
to {left:-13940px;}
}
#frame1st {
width:1080px;height:auto !important;min-height:450px;
border-color: #7b5640 #efc09a #efc09a #7b5640;border-style:solid;border-width:1px;
padding:24px;
background-image:url(https://z3.ax1x.com/2021/06/28/Rtl1ld.jpg);
position:relative; margin:100px 0 32px -120px;
border-radius:5%;
overflow:hidden;
}
#frame2nd {
width:auto;
height:auto !important;min-height:450px;
background-image:url(https://z3.ax1x.com/2021/06/28/RtllSH.jpg);
border-color: #efc09a #7b5640 #7b5640 #efc09a;border-style:solid;border-width:1px;
padding:10px;
border-radius:5%;
overflow:hidden;
}
#frame3rd {
width:auto;height:auto !important;min-height:450px;
background-image:url(https://z3.ax1x.com/2021/06/28/RtQQrq.gif);
border-color: #7b5640 #efc09a #efc09a #7b5640;border-style:solid;border-width:1px;
padding:10px;
border-radius:5%;
overflow:hidden;
}
#frame4th {
width:auto;height:auto !important;min-height:450px;
background-image:url(https://z3.ax1x.com/2021/06/28/RtQn2j.jpg);
border-color: #efc09a #7b5640 #7b5640 #efc09a;border-style:solid;border-width:1px;
padding:10px;
border-radius:5%;
overflow:hidden;
}
#frame5th {
width:auto;height:auto !important;min-height:450px;
background-image:url(https://z3.ax1x.com/2021/06/28/RtlMfe.jpg);
border-color: #7b5640 #efc09a #efc09a #7b5640;border-style:solid;border-width:1px;
padding:10px;
border-radius:5%;
overflow:hidden;
}
.playbutton {
width:430px;height:430px;
background-image:url(http://img95.699pic.com/xsj/06/2y/ir.jpg);
background-position-y:-260px;
position:absolute;
transform:scale(0.08);
overflow:hidden;border-radius:50%;
}
.ctrlbutton {
width:230px;height:230px;
background-image:url(http://pic.soutu123.cn/element_origin_min_pic/16/12/30/9892ef66b0537853ff37511ad2cfe2cf.jpg);
background-position-x:-287px;
overflow:hidden;border-radius:50%;transform:scale(0.12);
}
</style>
<div id="frame1st">
<div id="frame2nd">
<div id="frame3rd">
<div id="frame4th">
<div id="frame5th">
<div id="slideframe">
<div id="pichold">
<div style="background-position-y: -170px;" class="鼻烟壶"></div>
<div style="background-position-y: -640px;" class="鼻烟壶"></div>
<div style="background-position-y: -1110px;" class="鼻烟壶"></div>
<div style="background-position-y: -1590px;" class="鼻烟壶"></div>
<div style="background-position-y: -2060px;" class="鼻烟壶"></div>
<div style="background-position-y: -2520px;" class="鼻烟壶"></div>
<div style="background-position-y: -2990px;" class="鼻烟壶"></div>
<div style="background-position-y: -3440px;" class="鼻烟壶"></div>
<div style="background-position-y: -3920px;" class="鼻烟壶"></div>
<div style="background-position-y: -4380px;" class="鼻烟壶"></div>
<div style="background-position-y: -4850px;" class="鼻烟壶"></div>
<div style="background-position-y: -5320px;" class="鼻烟壶"></div>
<div style="background-position-y: -5780px;" class="鼻烟壶"></div>
<div style="background-position-y: -6240px;" class="鼻烟壶"></div>
<div style="background-position-y: -6700px;" class="鼻烟壶"></div>
<div style="background-position-y: -7160px;" class="鼻烟壶"></div>
<div style="background-position-y: -7610px;" class="鼻烟壶"></div>
<div style="background-position-y: -8070px;" class="鼻烟壶"></div>
<div style="background-position-y: -8530px;" class="鼻烟壶"></div>
<div style="background-position-y: -8970px;" class="鼻烟壶"></div>
<div style="background-position-y: -9430px;" class="鼻烟壶"></div>
<div style="background-position-y: -9880px;" class="鼻烟壶"></div>
<div style="background-position-y: -10350px;" class="鼻烟壶"></div>
<div style="background-position-y: -10820px;" class="鼻烟壶"></div>
<div style="background-position-y: -11280px;" class="鼻烟壶"></div>
<div style="background-position-y: -11740px;" class="鼻烟壶"></div>
<div style="background-position-y: -12200px;" class="鼻烟壶"></div>
<div style="background-position-y: -12670px;" class="鼻烟壶"></div>
<div style="background-position-y: -13140px;" class="鼻烟壶"></div>
<div style="background-position-y: -13590px;" class="鼻烟壶"></div>
<div style="background-position-y: -14040px;" class="鼻烟壶"></div>
<div style="background-position-y: -14500px;" class="鼻烟壶"></div>
<div style="background-position-y: -14950px;" class="鼻烟壶"></div>
<div style="background-position-y: -15400px;" class="鼻烟壶"></div>
<div style="background-position-y: -15850px;" class="鼻烟壶"></div>
<div style="background-position-y: -16310px;" class="鼻烟壶"></div>
<div style="background-position-y: -16770px;" class="鼻烟壶"></div>
<div style="background-position-y: -17200px;" class="鼻烟壶"></div>
<div style="background-position-y: -17660px;" class="鼻烟壶"></div>
<div style="background-position-y: -18120px;" class="鼻烟壶"></div>
<div style="background-position-y: -18560px;" class="鼻烟壶"></div>
<div style="background-position-y: -170px;" class="鼻烟壶"></div>
<div style="background-position-y: -640px;" class="鼻烟壶"></div>
<div style="background-position-y: -1110px;" class="鼻烟壶"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--img src="http://bpic.588ku.com/element_pic/01/39/84/84573cd8a135d3a.jpg" id="lbutton"
style="width:32px;overflow:hidden;border-radius:50%;position:absolute;bottom:0px;left:400px;" -->
<div id="lbutton" class="ctrlbutton"
style="background-position-y:-287px;position:absolute;bottom:-100px;left:300px;"></div>
<!--img src="http://img.download.pchome.net/3l/jr/143567_120x90.jpg" id="pbutton"
style="width:32px;overflow:hidden;border-radius:50%;position:absolute;bottom:0px;left:540px;" -->
<div id="pbutton" class="playbutton"
style="background-position-x:-70px;position:absolute;bottom:-200px;left:350px;"></div>
<!--img src="http://bpic.588ku.com/element_pic/01/80/35/86574d7377e4eae.jpg" id="rbutton"
style="width:32px;overflow:hidden;border-radius:50%;position:absolute;bottom:0px;right:400px;" -->
<div id="rbutton" class="ctrlbutton"
style="background-position-y:-18px;position:absolute;bottom:-100px;right:300px;"></div>
</div>
<audio src="https://ss2.meipian.me/users/60902957/151390d0-8c44-11ea-80aa-d1fb47062e8d.mp3" loop="" id="bplayer" style="visiblity:hidden;"></audio>
<script type="text/javascript">
var pbutton = document.querySelector('#pbutton');
var lbutton = document.querySelector('#lbutton');
var rbutton = document.querySelector('#rbutton');
var bplayer = document.querySelector('#bplayer');
var pichold = document.querySelector('#pichold');
pbutton.onclick = function() {
if(bplayer.paused) {
bplayer.play();
//pbutton.src = "http://photo.16pic.com/00/20/92/16pic_2092589_b.jpg";
pbutton.style.backgroundPositionX = "-530px";
}
else {
bplayer.pause();
//pbutton.src = "http://img.download.pchome.net/3l/jr/143567_120x90.jpg";
pbutton.style.backgroundPositionX = "-70px";
}
}
lbutton.onclick = function() {
pichold.style.animation = "picMoveLeft 175s linear infinite";
}
rbutton.onclick = function() {
pichold.style.animation = "picMoveRight 175s linear infinite";
}
</script>
代码做得很棒,我先转移到【代码图腾】版块了啊
页:
1
[2]