简体   繁体   English

jQuery-左右动画

[英]jQuery - left to right animation

I am trying to do something similar this guy did here 我正在尝试做这个家伙在这里做的类似的事情
However, I want my animation to go from left to right as opposed to right to left. 但是,我希望动画从左到右,而不是从右到左。

Now since all divs are actually positioned inline i have tried to specify direction: rtl on the parent div, but it still does not work. 现在,由于所有div实际上都位于行inline我尝试指定direction: rtl父div上的direction: rtl ,但仍然无法正常工作。 (my view remains on the left side on the page, I would like to see the rightmost div first and then when I slide the left divs they move to the right). (我的视图仍然在页面的左侧,我想先看到最右边的div,然后在滑动左div时将其移到右侧)。

Thank you. 谢谢。

LE: Here is the solution for those interested http://jsfiddle.net/oq4p28wg/ LE:这是针对感兴趣的http://jsfiddle.net/oq4p28wg/的解决方案

From moving left to right in the example referenced they add margin-left to move between slides, until reaching a maximum number of slides. 在所引用的示例中,它们从左向右移动,向左增加margin-left以在幻灯片之间移动,直到达到最大数量的幻灯片为止。 In your case to move in the opposite direction you will need to start with the maximum margin-left and substract margin to move from right to left in the slides until reaching the first slide and therefore margin-left:0 . 如果您要朝相反的方向移动,则需要margin-left最大margin-left开始,然后减去边距,以在幻灯片中从右向左移动,直到到达第一张幻灯片,因此到达margin-left:0

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

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