100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > JS小功能(offsetLeft实现图片滚动效果)实例代码【javascript】

JS小功能(offsetLeft实现图片滚动效果)实例代码【javascript】

时间:2020-10-17 17:28:16

相关推荐

JS小功能(offsetLeft实现图片滚动效果)实例代码【javascript】

web前端|js教程

JS,offsetLeft,图片滚动

web前端-js教程

效果:

代码:

新葡京源码下载,ubuntu永久添加路由,tomcat怎么改编码,爬虫python服务,php入门英语,河南线上营销郑州seo优化软件lzw

表单验证源码,win启动引导ubuntu,绿色版tomcat 图标,爬虫数据缺失,php接口编码设定,seo查询湖南岚鸿seolzw

#div1

{

width: 245px;

height: 150px;

background: red;

margin: 250px;

margin-left: 500px;

position: absolute;

overflow: hidden;

}

#div1 ul li

{

float: left;

width: 44px;

height: 66px;

margin-top: 20px;

margin-right: 5px;

list-style: none;

}

#div1 ul

{

width: 250px;

position: absolute;

padding: 0;

}

window.onload = function () {

var oul = document.getElementsByTagName(ul)[0];

var odiv = document.getElementById(div1);

var ali = document.getElementsByTagName(li);

oul.innerHTML = oul.innerHTML + oul.innerHTML;

oul.style.width = (ali[0].offsetWidth + 5) * ali.length + px;

function roll() {

if (oul.offsetLeft <= -oul.offsetWidth / 2) {

oul.style.left = ;

}

oul.style.left = oul.offsetLeft - 2 + px;

}

var timer = null;

timer = setInterval(roll, 30);

odiv.onmouseover = function () {

clearInterval(timer);

}

odiv.onmouseout = function () {

timer = setInterval(roll, 30);

}

};

mud游戏源码合集,vscode代码炫酷插件,Ubuntu的域名,tomcat 没显示图标,链接爬虫原理,php post传参数,天津推荐的seo优化排行,p2p平台网站源码,dede 商业模板打包下载lzw

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。