简体   繁体   English

HTML JS和CSS列表选取框无法正确显示

[英]HTML JS and CSS list marquee not properly displayed

I have modified a code that displays a marquee scrolling a simple HTML list. 我已经修改了显示滚动字幕的简单HTML列表的代码。 You can see it here : I have 3 problems that I can't solve: 您可以在此处看到:我有3个无法解决的问题:

  1. JS: I would like the marquee to show the text entering again through the right just after it disappears through the left, something like a continuous marquee, how could I do it ? JS:我希望选框显示出从左侧消失后又从右侧再次输入的文本,就像连续选框一样,我该怎么办?

  2. CSS: I am noticing (a) some artifacts in the marquee, I think this is due to the marquee text and the margins/paddings of divs not being properly set; CSS:我注意到(a)选框中的一些瑕疵,我认为这是由于选框文本和div的边距/填充没有正确设置所致; and (b) the shadow of the lighter blue div cut over the marquee.. (I think it may be a z-indez problem?). (b)较浅的蓝色div阴影遮盖了选取框。(我认为这可能是z-indez问题?)。 (b) appears with any browser, (a) only with chrome, firefox looks ok. (b)与任何浏览器一起出现,(a)仅与chrome一起使用,firefox看起来还可以。 How could I fix it ? 我该如何解决?

    Here's a screenshot: 这是屏幕截图: 在此处输入图片说明

  3. I can successfully load data from my db and append it to the marquee. 我可以成功地从数据库加载数据并将其附加到选取框。 Now, I want to "refresh" the contents of the marquee every X seconds, would it be ok to remove the top element of the list when appending one in the bottom, or would it be better to fade-out, update everything, and fade-in again? 现在,我想每隔X秒“刷新”选取框的内容,在底部添加一个时可以删除列表的顶部元素,还是最好淡出,更新所有内容并再次淡入? Any other ways to do it ? 还有其他方法吗?

Here is a simple example to deal with scrolling them in from the opposite side. 这是一个简单的示例 ,用于从相反侧滚动它们。 Also, if you adapt this method you can simply add or delete new items in the array as you need too. 同样,如果您采用这种方法,您也可以根据需要简单地在数组中添加或删除新项。 Watch this and about 2 or 3 times through it will add new items. 观看此视频,大约2到3次将添加新项目。 One important thing to note is make sure the width of the div with id text is wider then the length of all visible items plus the length of the next in line. 需要注意的一件事是,确保带有id文本的div的宽度比所有可见项的长度加上下一行的长度还要宽。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM