【JavaScript ScrollLoopMenu插件用法示例】在本文中, 我们将学习如何实现滚动循环菜单使用基于JavaScript滚动循环菜单插入。它是开发网页时使用的另一种简单且交互式的滚动菜单, 用于获得不错的视觉效果。
注意:请下载JavaScript滚动循环菜单插件在工作文件夹中, 并在HTML代码的开头部分包含必需的文件。
< link href =" https://use.typekit.net/rtr2vsr.css" rel =" stylesheet" type ="text/css"/>例子:以下示例演示了使用HTML控件和基于JavaScript的滚动循环菜单滚动循环菜单插入。插件的" base.css"文件的" menu", " menu__item-inner", " frame__link"等不同的类被附加到HTML标记, 如下所示, 以获得预期的输出。
< link href ="https://www.lsbin.com/css/base.css" rel ="stylesheet" type="textcss"/>
< script src ="https://www.lsbin.com/js/index.js"> < /script>
<
!DOCTYPE html>
<
html lang = "en" class = "no-js">
<
head>
<
meta charset = "UTF-8" />
<
meta name = "viewport"
content=" width = device -width, initial-scale = 1 " />
<
title>
Scroll Loop Menu Plugin<
/title>
<
meta name = "description"
content = "scroll loop animation." />
<
meta name = "keywords"
content = "Enter keywords in your web page" />
<
link rel = "stylesheet"
href = "https://use.typekit.net/rtr2vsr.css" />
<
link rel = "stylesheet"
type = "text/css"
href = "https://www.lsbin.com/css/base.css" />
<
/head>
<
body>
<
div class = "frame">
<
h1 class = "frame__title">
GFG Scroll Loop Menu<
/h1>
<
div class = "frame__links">
<
a href =
"https://www.lsbin.org/javascript-tutorial/"
class = "frame__link">
JavaScript
<
/a>
<
a href =
"https://www.lsbin.org/css-tutorials/" c
lass = "frame__link">
CSS
<
/a>
<
/div>
<
span class = "frame__button"
aria-hidden = "true">
Close<
/span>
<
/div>
<
nav class = "menu">
<
div class = "menu__item">
<
a class = "menu__item-inner">
Algorithms<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Data Structures<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Languages<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Interview Corner<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
GATE<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
ISRO CS<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
UGC NET CS<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
CS Subjects<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Web technologies<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Programming<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Careers<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Internship<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Placement course<
/a>
<
/div>
<
div class = "menu__item">
<
a class = "menu__item-inner">
Geek of the Month<
/a>
<
/div>
<
/nav>
<
script src = "https://www.lsbin.com/js/index.js">
<
/script>
<
/body>
<
/html>
输出如下:
在一开始的时候:
文章图片
单击带有链接的" div"时, 它将页面重定向到相应的" href"链接。
文章图片
以下显示了菜单的滚动菜单功能滚动循环菜单插入。
文章图片
推荐阅读
- Networxx模块的超链接诱导主题搜索(HITS)算法|Python
- 如何处理Win8.1鼠标间歇性失灵问题?
- Win8应用商店中没有检查更新选项如何应对?
- 如何调整Win8系统输入法切换的顺序
- Win8.1系统关闭硬件加速的办法
- 如何取消Windows8系统开机扫描驱动器?
- 如何给Win8.1系统添加一个新的账户?
- Win8开机黑屏只有光标怎样处理?
- Win8系统笔记本怎样关闭Fn热键