本文介绍了jQuery Blockui定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用blockui在我的网站上抛出一些表格,但由于某种原因,blockui元素位于距屏幕底部约20-30像素的位置.我根据文档(v2的jquery blockui选项)尝试使用此代码将其重新定位:

I'm using blockui to throw some forms up on my site but for some reason the blockui element is positioned about 20-30 pixels from the bottom of the screen. I tried, per the docs (jquery blockui options for v2) to reposition it using this code:

 $.blockUI({css: {top : '10px'}});

但是那只是以一种嘲笑的方式向我打了个哈欠,什么也没做.同样,根据文档,默认默认值为top:40%.我不想消灭所有blockui CSS,只需重置顶部位置即可.

But that just yawned at me in a universe mocking kind of way and did nothing. The default, again, per the docs, is top : 40%. I don't want to wipe out all the blockui css, just reset the top positioning.

推荐答案

我使用它,并且加载消息"位于右上角.只是玩CSS适合.

I use this and the Load Message is positioned to the top right hand corner. Just play with the css to suit.

希望这会有所帮助.

Rob

$.blockUI({
         message: '<img src="_assets/images/loading.gif" /><span style="margin-left:5px; font-family:arial;">Loading...</span>',
         fadeIn: 700,
         fadeOut: 700,
         timeout: 1000,
         showOverlay: false,
         centerY: false,
         css: {
             width: '150px',
             top: '10px',
             left: '',
             right: '10px',
             border: 'none',
             padding: '5px'
         }
     }); 

这篇关于jQuery Blockui定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 00:55