制作一个简单的jQuery轮播 [英] Making a simple jQuery carousel

查看:45
本文介绍了制作一个简单的jQuery轮播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个非常简单的jQuery轮播,通过一组控件后退进行推进前进,无限循环。似乎所有现成的功能都比我想要的功能更多。

I'd like to make a very simple jQuery carousel, that advanced via a set of controls "back" | "forward", and loops infinitely. Seems like all the ready made ones have way more features than I'd like.

我现在的结构看起来像这样。
HTML:

The structure I have now looks like this. HTML:

<section id="content">
  <a class="back">Back</a>
  <a class="forward"/>Forward</a>

  <article>
   <p>Lorem ipsum</p>
  </article>

  <article>
   <p>Lorem ipsum</p>
  </article>

  <article>
   <p>Lorem ipsum</p>
  </article>

</section>

堆栈中的第一个是页面加载时的默认值,我想动画为当它向前移动时向左移动,向后移动向右移动。

The first one in the stack is the default on page load, and I'd like to animate to the left when it goes forward, and to the right when it goes backwards.

关于jQuery中这可能是什么样的指针?

Any pointers on what this might look like in jQuery?

推荐答案

30天学习jQuery 教程是一个简单的滑块实现,可以帮助你构建自己的轮播:

One (in fact two) of the lessons on 30 days to learn jQuery tutorial is a simple slider implementation that might help you to build your own carousel:

< a href =http://tutsplus.com/lesson/the-obligatory-slider/ =nofollow> http://tutsplus.com/lesson/the-obligatory-slider/

http://tutsplus.com/lesson/prototypal-继承和重构 - 滑块/

这篇关于制作一个简单的jQuery轮播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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