之前就會阻止基礎元素。即使在調用之前,我的引導模態也會阻止底層頁面的內容。如果屏幕截圖下方顯示的鏈接存在,則在調用模式之前無法訪問它。它充當一個層。一旦調用模態,我們又可以訪問基礎元素。引導模態甚至在它被稱爲
訪問莫代爾前:
一旦莫代爾訪問:
這裏是我的代碼在show.html.erb
。如何解決它?我們需要在我們的文檔中保留我們的Modal代碼嗎?
<!-- Modal for uploading Profile Image -->
<div class="modal fade" id="myPicUploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only"></span></button>
<h4 class="modal-title" id="myModalLabel">Upload Picture</h4>
</div>
<div class="modal-body">
<!-- Showing Exisiting Profile Image -->
<% if @user.avatar.present? %>
<%= image_tag @user.avatar.url(:profile), class: "img-thumbnail" %>
<%else%>
<%= image_tag "missing-profile.png", class: "img-thumbnail" %>
<%end%>
<p> </p>
<!-- Form to upload new pic -->
<%= simple_form_for @user do |f| %>
<%= f.input :avatar, label: false %>
</div>
<div class="modal-footer">
<%= f.submit "Save", class: "btn btn-primary" %>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<%end%>
</div>
</div>
</div>
</div>
<div ng-controller = "userLeftPanelCtrl" ng-init = "init()">
<!-- Left Panel of User -->
<div class="well UserProfileLeftPane span2" >
<!-- Panel options of User -->
<!-- Profile image of user -->
<div class="UserProfileImageLeftBar">
<% if @user.avatar.present? %>
<%= image_tag @user.avatar.url(:profile), class: "img-thumbnail" %>
<%else%>
<%= image_tag "missing-profile.png", class: "img-thumbnail" %>
<%end%>
<%= link_to '#' do %>
<span class="label label-primary" data-toggle="modal" data-target="#myPicUploadModal" >Upload Pic</span>
<%end%>
</div>
</div>
</div>
嘿,我已經嘗試了幾個地方..但沒有運氣..我仍然不清楚爲什麼我的模態雖然隱藏..但顯示在開發人員的工具和它的確在它下面的阻塞內容..可能是什麼原因。 – 2014-10-02 16:50:40