如何在此代码中单击时减慢文本速度?

时间:2015-12-23 08:56:43

标签: javascript jquery html5 jquery-ui twitter-bootstrap-3

<div class="row">
    <div class="span4 collapse-group">
        <p class="collapse" id="viewdetails">Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
        <p>
            <a class="btn btn-danger" data-toggle="collapse" data-target="#viewdetails">View details &raquo;</a>
        </p>
    </div>

1 个答案:

答案 0 :(得分:0)

对于慢下来,您可以使用jQuery这样尝试:

<div class="row">
<div class="span4 collapse-group">
    <p>
        <a class="btn btn-danger" data-toggle="collapse" data-target="#viewdetails">View details &raquo;</a>
    </p>
    <p class="collapse" id="viewdetails">Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>        
</div>
</div>

您的JQuery代码:

<script type="text/javascript">
  $(".btn-danger").click(function(){
    $("p").slideDown(1000);
  }); 
</script>