简体   繁体   English

动画向左和向右移动?

[英]animate move to the left and to the right?

I want is to move my pagination to the left and to the right after clicked on #prev_pag and #next_pag . 我想要的是在单击#prev_pag#next_pag之后,将分页向左和向右#next_pag how is it and solve my problem? 如何解决我的问题?

Eg: http://jsfiddle.net/szVKD/5/ 例如: http //jsfiddle.net/szVKD/5/

$('#next_pag').click(function() {
        $('#pagination').animate({
            left: '-=100px'
        },
        500);
    });
    $('#prev_pag').click(function() {
        $('#pagination').animate({
            left: '+=100px'
        },
        500);
    });
});

Needed to delete the last line for javascript to compile and added "position: relative;" 需要删除最后一行以便javascript进行编译,并添加“ position:relative;”。 to #pagination div. 到#pagination div。

http://jsfiddle.net/szVKD/9/ http://jsfiddle.net/szVKD/9/

This is a CSS issue. 这是一个CSS问题。 You need to set #pagination to position:relative; 您需要将#pagination设置为position:relative; in order to animate the left css property. 为了给left css属性设置动画。

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

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