0

首先http://wojoweb.pl/strony/pkpcargo/

我想向左/向右滑动或滚动内容。

html

       <div class="row">
            <div class="row">
            <div class="col-md-3">
                <h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tempus enim pellentesque suscipit ornare.</h4>
            </div>

            <div class="col-md-3">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tempus enim pellentesque suscipit ornare. Curabitur malesuada non ipsum ut venenatis. Fusce tristique, urna interdum venenatis congue, arcu dui rhoncus odio.</div>

            <div class="col-md-3">Sed dolor dui, sollicitudin vitae convallis ut, viverra vitae mauris. Sed quis egestas lacus. Pellentesque dictum ligula id justo porta condimentum. Etiam convallis dolor dui, a molestie nisi elementum vehicula. Aliquam erat volutpat.</div>

            <div class="col-md-3">Aenean quis mi eget augue suscipit cursus dictum eget est. Phasellus tempus nisi sit amet dui sollicitudin, vitae lacinia massa tempor. Aenean sit amet metus ut orci faucibus condimentum vitae mattis nisi. Nam volutpat turpis quis sapien molestie, nec dapibus elit interdum.</div>
        </div>

文本的底部将是导航(如左上角的导航)。它应该滑动两列(col-md-3)。任何人都可以给我建议如何做到这一点?或者给我一个很好的例子。

滑块应向左或向右离开屏幕。

4

1 回答 1

0

有你的解决方案。它为元素的 left 属性设置动画。

$(document).ready(function() {
    var $lefty = $('#yourelement').next();
    $lefty.animate({
      left: parseInt($lefty.css('left'),10) == 0 ?
        -$lefty.outerWidth() :
        0
  });
});

复制自http://www.learningjquery.com/2009/02/slide-elements-in-different-directions/

于 2013-11-07T19:37:37.247 回答