网站首页
高清电影
无损音乐
游戏攻略
电脑教程
破解资源
站长资源
软件下载
JS 实现Div向上浮动的实现代码
(编辑:jimmy 日期: 2024/10/11 浏览:
2
)
Html 及 JS 代码如下:
复制代码
代码如下:
<div id="newsOne" onmouseover="CleartTimeInterVal();" onmouseout="resetInterVal();"
style="position: absolute; width: 100px;">
<a href="https://www.jb51.net" target="_blank"></a>
</div>
<script type='text/javascript'>
var newsOne = document.getElementById("newsOne");
newsOne.style.bottom = 0;
newsOne.style.left = window.screen.availWidth - 100;
var bottom = 0;
function newsScroll() {
if (bottom > (window.screen.availHeight - window.screenTop)) {
bottom = 0;
newsOne.style.bottom = 0;
}
else {
bottom = bottom + 15;
newsOne.style.bottom = bottom;
}
}
var timeid = setInterval(newsScroll, 300);
function CleartTimeInterVal() {
clearInterval(timeid);
}
function resetInterVal() {
timeid = setInterval(newsScroll, 300);
}
</script>
在线运行:
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
上一篇:
JS控制按钮自动切换背景颜色(可暂停)
下一篇:
关于JS控制代码暂停的实现方法分享
最新资源
万代南梦宫逼迫中国选手弃权《铁拳》比赛 国籍不
《黑神话》官方手办引热议:真的很好看真的买不起
《黑神话:悟空》取景地灵岩寺现巨型悟空!挥舞大
秦咏.1997-歌咏诗情·历年名曲典故【音乐谷】【W
群星.1997-纯电影·电影歌曲剧照纪念篇【新艺宝】
邰肇玫.1981-雪歌(滚石25周年经典复刻系列)【滚
《Duck Side of the Moon》特色玩法介绍
《刀郎 辉煌10年绝版珍藏 3CD》[WAV/分轨][1.6G
《张韶涵 全面沦陷》[WAV/分轨][370MB]
《极品汽车音乐 三十而立 一起走过的岁月 2CD》
首页
音乐
电影
资源