如何在页面加载时在jquery中从右到左移动div

时间:2016-02-20 12:38:51

标签: jquery html

我想在页面加载时从右向左移动div,但我无法使其工作。我检查了其他答案并复制了它们但仍然无法正常工作。我认为主要是因为div嵌套在其他div中,我尝试了主div和嵌套div内部的不同组合,仍然无法正常工作

  <div class='wrapper16'>
  <div class="container">
    <div class="row">
      <div class="grid_12 s6">
        <h2>RESEARCH & DEVELOPMENT</h2>
      </div>
    </div>
    <div class="row">
      <div class="grid_6 mar_t_25 s7">


        <p class="p4 mar_t_15">
         Research and Development is continuosly carried out on the existing and future products to make these more price competitive without comprimisng the quality of the products.<br />
            Research & Development is a constant feature for maintaining high temperature stability polymers. </p>
        </p>

      </div>

    </div>

  </div>
</div>

Jquery是:

< script >
  $(document).ready(function() {
    var effect = 'slide';

    var duration = 500;

    $('#wrapper16').toggle(effect, "right", duration);
  }); 
< /script>

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
$("div").css({"left":"500px"}).animate({"left":"0px"}, "slow");
&#13;
div {
  position: absolute;
}
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
Hello! I am a div!
</div>
&#13;
&#13;
&#13;