...
大前端

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
esp8266创建web服务器 创建配网web网页 esp8266 EEPROM操作,储存数据到flash中 Arduino基础函数,常用函数大全 局域网扫描软件ipscan分享 win10/11: Windows Audio无法启动 错误 0x80070005:拒绝访问