网站常用的带上下箭头图片滚动展示特效,无缝图片滚动效果,点击箭头即可,可自定义图片数量。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>图片列表带箭头上下无缝滚动展示特效_武鸣人</title> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <style type="text/css"> body,div,ul,li{margin:0;padding:0;} body{background:#052D01;font:12px/1.5 arial;} #box_www_wuming_ren{position:relative;width:210px;height:700px;border:1px solid #5E8743;margin:20px;} #box_www_wuming_ren div{position:absolute;top:50%;left:50%;width:160px;height:570px;overflow:hidden;margin:-285px 0 0 -80px;} #box_www_wuming_ren .up,#box_www_wuming_ren .down_www_wuming_ren{position:absolute;left:50%;width:48px;height:48px;z-index:10;cursor:pointer;overflow:hidden;margin-left:-24px;text-indent:-9999px;background:url(/img/20240220_wuming_ren_77.jpg) no-repeat;} #box_www_wuming_ren .up{top:10px;background-position:0 0;} #box_www_wuming_ren .down_www_wuming_ren{bottom:10px;background-position:0 bottom;} #box_www_wuming_ren ul{position:absolute;width:160px;} #box_www_wuming_ren li{width:160px;height:190px;list-style:none;text-align:center;} #box_www_wuming_ren a{color:#fff;font-weight:700;text-decoration:none;} #box_www_wuming_ren img{width:156px;height:156px;display:block;margin-bottom:5px;border:2px solid #ccc;} </style> <script type="text/javascript"> //获取id function $ (id) { return typeof id === "string" ? document.getElementById(id) : id; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) //获取tagName function $$ (elem, oParent) { return (oParent || document).getElementsByTagName(elem); } //获取class function $$$ (className, oParent) { var aClass = []; var reClass = new RegExp("(//s|^)" + className + "($|//s)"); var aElem = $$("*", oParent); for (var i = 0; i < aElem.length; i++) reClass.test(aElem[i].className) && aClass.push(aElem[i]); return aClass }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) //初始化对象 function Roll () { this.initialize.apply(this, arguments) } Roll.prototype = { initialize: function (obj) { var _this = this; this.obj = $(obj); this.oUp = $$$("up", this.obj)[0]; this.oDown = $$$("down_www_wuming_ren", this.obj)[0]; this.oList = $$$("list_www_wuming_ren", this.obj)[0]; this.aItem = this.oList.children; this.timer = null; this.iHeight = this.aItem[0].offsetHeight; this.oUp.onclick = function () { _this.up() }; this.oDown.onclick = function () { _this.down() } }, up: function () { this.oList.insertBefore(this.aItem[this.aItem.length - 1], this.oList.firstChild); this.oList.style.top = -this.iHeight + "px"; this.doMove(0) }, down: function () { this.doMove(-this.iHeight, function () { this.oList.appendChild(this.aItem[0]); this.oList.style.top = 0; }) }, doMove: function (iTarget, callBack) { var _this = this; clearInterval(this.timer) this.timer = setInterval(function () { var iSpeed = (iTarget - _this.oList.offsetTop) / 5; iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed); _this.oList.offsetTop == iTarget ? (clearInterval(_this.timer), callBack && callBack.apply(_this)) : _this.oList.style.top = iSpeed + _this.oList.offsetTop + "px" }, 30) } };//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) window.onload = function () { new Roll("box_www_wuming_ren"); };//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) </script> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <div id="box_www_wuming_ren"> <span class="up">up</span> <span class="down_www_wuming_ren">down</span> <div> <ul class="list_www_wuming_ren"> <li><a href="javascript:;"><img src="/img/20240220_wuming_ren_78.jpg" />武鸣人一号图片</a></li> <li><a href="javascript:;"><img src="/img/20240220_wuming_ren_79.jpg" />武鸣人二号图片</a></li> <li><a href="javascript:;"><img src="/img/20240220_wuming_ren_80.jpg" />武鸣人三号图片</a></li> <li><a href="javascript:;"><img src="/img/20240220_wuming_ren_81.jpg" />武鸣人四号图片</a></li> <li><a href="javascript:;"><img src="/img/20240220_wuming_ren_82.jpg" />武鸣人五号图片</a></li> </ul> </div> </div> </body> </html>
本文来自武鸣人网站,转载请注明出处