Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使我的JQuery图像浮动到页面顶部?_Jquery_Ruby On Rails_Ruby_Twitter Bootstrap_Jquery Masonry - Fatal编程技术网

如何使我的JQuery图像浮动到页面顶部?

如何使我的JQuery图像浮动到页面顶部?,jquery,ruby-on-rails,ruby,twitter-bootstrap,jquery-masonry,Jquery,Ruby On Rails,Ruby,Twitter Bootstrap,Jquery Masonry,如你所见,在我的页面顶部,我有一个用户的头像(个人资料图片)拉到左边。我还在右边的另一列中列出了该用户的所有帖子。问题是,自从添加了化身后,帖子就不会从页面顶部开始 这是我的视图文件: <div class="row"> <div class="col-md-3" 'pull-left'> <strong><%= @user.username %></strong> <br> <%

如你所见,在我的页面顶部,我有一个用户的头像(个人资料图片)拉到左边。我还在右边的另一列中列出了该用户的所有帖子。问题是,自从添加了化身后,帖子就不会从页面顶部开始

这是我的视图文件:

<div class="row">

    <div class="col-md-3" 'pull-left'>

      <strong><%= @user.username %></strong> <br>
      <%= image_tag @user.avatar(:thumb) %>
    </div>
    </div>

<div class="col-md-12">
      <div id="things" class="transitions-enabled">

  <% @user.things.each do |thing| %>
    <div class='panel panel default'>
    <div class="box">
      <%= link_to image_tag(thing.image.url(:medium)), thing %>
      <div class='panel-body'>
      <strong><p><%= thing.title %></p></strong>
      <p><%= thing.description %></p>
  By <%= link_to thing.user.username, thing.user %>

  <% if thing.user == current_user %>
    <%= link_to edit_thing_path(thing) do %>
    <span class='glyphicon glyphicon-edit'></span> Edit
  <% end %>
  <%= link_to thing_path(thing), method: :delete, data: { confirm: 'Are you sure?' } do %>
    <span class='glyphicon glyphicon-trash'></span> Delete
  <% end %>
  </div>
  <% end %>
  </div>
</div>
  <% end %>
</div> 
</div>
  </div>
  </div>


通过 编辑 删除
编辑

更新

<div class="row">

    <div class="col-md-3 avatar">

      <strong><%= @user.username %></strong> <br>
      <%= image_tag @user.avatar(:thumb) %>
    </div>
    </div>

<div class="col-md-9">
      <div id="things" class="transitions-enabled">

  <% @user.things.each do |thing| %>
    <div class='panel panel default'>
    <div class="box">
      <%= link_to image_tag(thing.image.url(:medium)), thing %>
      <div class='panel-body'>
      <strong><p><%= thing.title %></p></strong>
      <p><%= thing.description %></p>
  By <%= link_to thing.user.username, thing.user %>

      <% if thing.user == current_user %>
        <%= link_to edit_thing_path(thing) do %>
        <span class='glyphicon glyphicon-edit'></span> Edit
      <% end %>
      <%= link_to thing_path(thing), method: :delete, data: { confirm: 'Are you sure?' } do %>
       <span class='glyphicon glyphicon-trash'></span> Delete
       <% end %>
      </div>
      <% end %>
      </div>
    </div>
  <% end %>
</div> 
</div>
  </div>
  </div>


通过 编辑 删除
您需要在Bootstrap中的同一行下定义“事物”和“化身”

<div class="row">
  <div class="col-md-3 avatar"></div>
  <!-- Reduce it to 9 cols here -->
  <div class="col-md-9">
    <div id="things"></div>
  </div>
</div>


我认为您不需要向左拉,因为代码中也有语法错误-应该与其他类位于相同的引号中

Hmm。。。这似乎不起作用。我会用我改变的内容更新原来的帖子。这一页看起来还是一样。