js实现上下滚动列表消息代码
代码语言:html
所属分类:其他
代码描述:js实现上下滚动列表消息代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> * { margin: 0; padding: 0; } html, body { min-width: 100%; min-height: 100vh; background-color: #2A2A2A; } body { position: relative; } .box { width: 900px; height: 50px; background-color: cadetblue; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; overflow: hidden; color: #fff; border-radius: 5px; } .box ul { position: absolute; top: 0; left: 0; } .box ul li { line-height: 50px; list-style: none; padding: 0 30px; box-sizing: border-box; cursor: pointer; } </style> </head> <body> <div class="box"> <ul> </ul> </div> <script > let arr = ["今日头条 :bfw爱编程发布新功能", "招聘信息: 招聘一名运营", "失物招领 : 丢失一个钱包", "技术实训 : go领先java"]; var settings = { speeds: 10, isPause: true, isHover:false, }; var ul = document.querySelector("ul"); arr.forEach((item) => { .........完整代码请登录后点击上方下载按钮下载查看
网友评论0