How do I create a horizontal text slider in JQuery and/or CSS?

I am trying to create a text slider to slide between 4 different sentences. I can’t get it to work, and as a matter of fact, I can’t get the code to function at all. I need to start fresh, but I have no idea how to create one that will switch between sentences.

Any help on creating one with CSS3
or jQuery, as I don’t really have a preference, is greatly appreciated.

Problem courtesy of: Scott Plunkett

Solution

Just setup for containers (using span’s in this example):

Sentence once Sentence two Sentence three Sentence four

Now in your CSS, set them to position themselves side by side, preferably setting the span width to that of the parent_container.

In jQuery, you can now either, hide()
and show()
each individual
as necessary, or
animate()

the transition between the spans. Per your question, it sounds like you want to
animate()

with a slide.

Solution courtesy of: Louis

稿源:CSS3 Recipes (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » How do I create a horizontal text slider in JQuery and/or CSS?

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录