무작위로 나타납니다. 모달 대화 상자를 사용하여 부분 내부를 표시합니다.jquery UI 대화 상자가 페이지 하단의
저는 simple_form + bootstrap 및 jquery-ui로 작업하고 있습니다.
함수를 호출 버튼이보기에이 코드를 가지고 내보기/부츠
<p><%= link_to 'New Boots', new_boot_path, :class => 'btn btn-primary pull-right', :remote => true, :id => 'new_boot_link' %></p>
을/새 코드는 이것이다 :
<div id="content">
<%= render :partial => 'form' %>
</div>
및보기/부츠/_form에서
application.js에서 다음<%= simple_form_for(@boot, :html => { :class => 'form-vertical' }, :remote => true) do |f| %>
<fieldset>
<%= f.input :number %>
<%= f.input :size, :collection => boot_size_options %>
<%= f.input :condition, :collection => boot_condition_options %>
<%= f.input :brand , :collection => boot_brand_options %>
</fieldset>
<div class="form-actions">
<%= f.button :submit, :class => 'btn btn-primary' %>
<%= submit_tag 'Reset', :type => :reset, :class => "btn btn-danger" %>
</div>
<% end %>
나는 다음과 같은 한 :
,$(document).ready(function() {
$('#new_boot_link').click(function(e) {
var url = $(this).attr('href');
$('#modal').dialog({
title: "New Boots",
draggable: true,
resizable: false,
modal: true,
width:'auto',
open: function() {
return $(this).load(url + ' #content');}
});
});
});
모달은 정상적으로 작동하지만 화면 하단에 나타납니다. 그러나 버튼을 닫고 다시 클릭하면 첫 번째 마커에서와 같이 중간에 표시됩니다. 장소.
CSS입니까? 나는 그렇지 않다는 생각으로 아마 같은 장소에서 끊임없이 계속 나타날 것입니다 ... 그래서 나는 함수를 호출하는 방법이 있는지 모른다.
제안을 환영합니다. 이것은 매우 짜증나는 결함입니다!
환상적! 그것은 완벽하게 작동합니다! 고맙습니다. – Lievcin