...
大前端

js-实现文字滚动JQuery插件 marquee.js Marquee标签的jquery替代

以前我们使用文字滚动的时候是用 html中的Marquee标签

而今Marquee标签已经被废弃了

尽量不要使用Marquee标签

那么现在要做文字滚动该怎么办呢

要么用CSS3或者JS实现

Jq有一个插件就是专门替代Marquee的


安装

下面是 github 地址 :

https://github.com/aamirafridi/jQuery.Marquee


使用

<script src="//cdn.jsdelivr.net/npm/jquery.marquee@1.5.0/jquery.marquee.min.js" type="text/javascript"></script>

html:

<div class='marquee'>Lorem ipsum dolor sit amet, consectetur adipiscing elit END.</div>

css:

.marquee {
width: 300px; /* the plugin works for responsive layouts so width is not necessary */
overflow: hidden;
border:1px solid #ccc;
}

js:

$('.marquee').marquee({
//duration in milliseconds of the marquee
duration: 15000,
//gap in pixels between the tickers
gap: 50,
//time in milliseconds before the marquee will start animating
delayBeforeStart: 0,
//'left' or 'right'
direction: 'left',
//true or false - should the marquee be duplicated to show an effect of continues flow
duplicated: true
});



css、js实现网页内容禁止选中,禁止网页选择文字 QQ音乐 qmc* | mgg | mflac 格式转换 ogg mp3 免费
biu biu biu
go golang 配置国内源,解决go get卡住 奇特的一个需求,在指定时间内随机间隔跑完指定的步数,使用js实现方法 前端JS使用Zip打包下载 HID 报告描述详解 STC8G驱动WS2812