什么是JS或JQuery的水平滚动新闻自动收报机的好处 [英] What's a good bit of JS or JQuery for horizontally scrolling news ticker

查看:125
本文介绍了什么是JS或JQuery的水平滚动新闻自动收报机的好处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些JQuery或JS,它允许我生成一个水平滚动的新闻自动收报机列表。

I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list.

生成的HTML需要是标准也符合要求。

The produced HTML needs to be standards compliant as well.

我试过 liScroll 但这有一个破坏的习惯(某些内容在滚动开头的第二行结束),特别是对于更长的列表。

I have tried liScroll but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longer lists.

我也尝试过此新闻报道但是当包含DOCTYPE时,滚动会在每个周期结束时摇晃而不是平稳循环。

I have also tried this News Ticker but when a DOCTYPE is included the scrolling will jolt rather than cycle smoothly at the end of each cycle.

任何建议都表示赞赏。

编辑

感谢Matt Hinze的建议我意识到我可以做我想用JQuery动画制作的东西(我需要连续滚动而不是离散像示例一样滚动)。但是,我很快遇到了与liScroll相似的问题,毕竟认识到CSS问题(一如既往)是负责任的。

So thanks to Matt Hinze's suggestion I realised I could do what I wanted to do with JQuery animate (I require continuous scrolling not discrete scrolling like the example). However, I quickly ran into similar problems to those I was having with liScroll and after all that realised a CSS issue (as always) was responsible.

解决方案:liScroll - 更改默认的'var stripWidth = 0'到100之类的东西,给一点空间并避免换行。

Solution: liScroll - change the default 'var stripWidth = 0' to something like 100, to give a little space and avoid new line wrapping.

推荐答案

平滑Div Scroll也可以用作新闻自动收报机/股票代码。它可以暂停鼠标悬停或鼠标按下它可以无限循环,如果你想要它。

Smooth Div Scroll can also be used as a news ticker/stock ticker. It can pause on mouse over or mouse down and it can loop endlessly if you want it to.

这是示例,带有正在运行的代码。

Here's the example with a running ticker.

这篇关于什么是JS或JQuery的水平滚动新闻自动收报机的好处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆