弹出框居中
This commit is contained in:
parent
0a0d67642a
commit
10eeeaa95c
|
@ -1,8 +1,10 @@
|
||||||
//var screenWidth = $(window).width();
|
var screenWidth = $(window).width();
|
||||||
//var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
|
var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
|
||||||
//var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
|
var boxWidth = 452;
|
||||||
//var objLeft = (screenWidth - 2)/2.5 ; //2 可以根据需要修改
|
|
||||||
//var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
|
var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
|
||||||
|
var objLeft = (screenWidth - boxWidth)/2 ; //2 可以根据需要修改
|
||||||
|
var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
|
||||||
//var popupHeight = $(".resourceSharePopup").outerHeight(true);
|
//var popupHeight = $(".resourceSharePopup").outerHeight(true);
|
||||||
//$(".resourceSharePopup").css("marginTop",-popupHeight/2);
|
//$(".resourceSharePopup").css("marginTop",-popupHeight/2);
|
||||||
//
|
//
|
||||||
|
@ -19,7 +21,7 @@
|
||||||
showModal('ajax-modal', '452px');
|
showModal('ajax-modal', '452px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
$('#ajax-modal').parent().css("top","415px").css("left","1045px");
|
$('#ajax-modal').parent().css("top",objTop+"px").css("left", objLeft+200+ "px");
|
||||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
var val = $("#search_course_input").val();
|
var val = $("#search_course_input").val();
|
||||||
|
|
|
@ -5,10 +5,19 @@
|
||||||
<% elsif params[:send_type] == 'message' %>
|
<% elsif params[:send_type] == 'message' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
var screenWidth = $(window).width();
|
||||||
|
var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
|
||||||
|
var boxWidth = 452;
|
||||||
|
|
||||||
|
var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
|
||||||
|
var objLeft = (screenWidth - boxWidth)/2 ; //2 可以根据需要修改
|
||||||
|
var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
|
||||||
|
|
||||||
showModal('ajax-modal', '452px');
|
showModal('ajax-modal', '452px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
$('#ajax-modal').parent().css("top","415px").css("left","1045px");
|
$('#ajax-modal').parent().css("top",objTop+"px").css("left",objLeft+200+"px");
|
||||||
$('#ajax-modal').parent().addClass("popbox").addClass("shareDP");
|
$('#ajax-modal').parent().addClass("popbox").addClass("shareDP");
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
var val = $("#search_org_input").val();
|
var val = $("#search_org_input").val();
|
||||||
|
|
|
@ -5,10 +5,19 @@
|
||||||
<% elsif params[:send_type] == 'message' %>
|
<% elsif params[:send_type] == 'message' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
var screenWidth = $(window).width();
|
||||||
|
var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
|
||||||
|
var boxWidth = 452;
|
||||||
|
|
||||||
|
var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
|
||||||
|
var objLeft = (screenWidth - boxWidth)/2 ; //2 可以根据需要修改
|
||||||
|
var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
|
||||||
|
|
||||||
showModal('ajax-modal', '452px');
|
showModal('ajax-modal', '452px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
$('#ajax-modal').parent().css("top","415px").css("left","1045px");
|
$('#ajax-modal').parent().css("top",objTop+"px").css("left",objLeft+200+"px");
|
||||||
$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox")
|
$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox")
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
//$("#search_project_input").focus();
|
//$("#search_project_input").focus();
|
||||||
|
|
Loading…
Reference in New Issue