作者liisi (小心一点)
看板Ajax
标题[问题] jquery dialog 视窗在网页上置中的问题
时间Fri Sep 15 16:57:40 2017
大家午安 有问题想请教一下
我们网站 是用jquery dialog 来呈现弹跳视窗
在电脑网页上 是有随着网页置中
但是在手机上看网页(非RWD) 却不会置中 会偏左 甚至直接对齐左边的网页
我透过google看了dialog的css , 是left的问题
但是我却找不到调整left的地方 想说是不是想在jquery里面 囧...
另外 在show or hide 是否可以由右边 滑出和消失
我google了一下 设定 show: "slide", showOpt: {direction: 'right'},
但是滑出的效果 却是向左滑出 改成 top down 都一样
目前jquery版本是 jquery-ui-1.8.19.custom.css , jquery-1.7.2.min.js
是因为这版本不支援吗?
还是说我找错了 = =||
最後一个问题
如果 视窗弹出之後 是否有设定parent的网页 不要被锁住?
或者是 网页上 往下拉时 视窗会随之变更位置
因为在视窗上的功能 会让使用者进行作业 也有分页
画面是比较多元的
所以不能用简单的div来制作
下方是程式码..
$(document).ready(function() {
$("
#dialog-msg").dialog("close");
$('body').append('<div id="category_edit_dialog"
style="display:none;"></div>');
$("
#category_edit_dialog").dialog({
modal: true,
hide: 'slide',
draggable: true,
autoOpen: true,
resizable: false,
width: w, /*透过参数带入*/
height: h, /*透过参数带入*/
position: {my: "center", at: "center", of: window },
open: function (event, ui)
{
$('
#category_edit_dialog').css('overflow', 'hidden');
}
});
$(".ui-dialog-titlebar").hide();
$('.ui-widget-overlay').click(function() { dialog_close(); });
$('
#category_edit_dialog').html('<iframe src='xxx'
frameborder="0" height="100%" width="100%" id="dialogFrame"></iframe>');
});
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 202.39.58.43
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Ajax/M.1505465863.A.E86.html
1F:→ jhnny97: JQuery UI没能满足你需求的部分,还是回到JQuery就好了吧 09/18 04:09
2F:→ jhnny97: 然後随视窗移动就 .css('position':'fixed') 09/18 04:09