Comments (4)
I, too, have had this issue for ages, but have just put up with it. I hope someone can help!
from blockui.
For now the only "workaround" i found is to set:
$.blockUI.defaults.centerX = false;
$.blockUI.defaults.centerY = false;
But then you must adjust top/left coords. manually ... Not a really flexible solution!
We should find the best "centering" paradigm, then modify the center(el, x, y) function inside blockUi code :/
Let me know if you go farther in this .. I'll do the same! ;)
from blockui.
This is what I use for hidden divs (tab-pane not active is hidden). since divs are hidden, message is not centered.
Only caveat of this solution is , it is centered horizontally not vertically
https://jsfiddle.net/bababalcksheep/4kc3sg6e/59/
centerX:false,
centerY:false,
'css': {
'border': '0',
'padding': '0',
'width': '100%',
'height': '100%',
'top': '0',
'left': '0',
},
'overlayCSS': {
'backgroundColor': '#000',
'opacity': 0.1,
'cursor': 'wait'
}
from blockui.
https://jsfiddle.net/bababalcksheep/4kc3sg6e/83/
// uses https://github.com/dreamerslab/jquery.actual
// to center message block
function center(el) {
var parentNode = el.parent();
var parentNode_BLW = parseInt(parentNode.css('border-left-width'), 10) || 0;
var parentNode_BTW = parseInt(parentNode.css('border-top-width'), 10) || 0;
var left = ((parentNode.actual('outerWidth') - el.actual('outerWidth')) / 2) - parentNode_BLW;
var top = ((parentNode.actual('outerHeight') - el.actual('outerHeight')) / 2) - parentNode_BTW;
el.css('left', left > 0 ? (left + 'px') : '0');
el.css('top', top > 0 ? (top + 'px') : '0');
}
You can use this function and you can use it on windows resize or tab shown event or even onBLock event.
see fiddle.
from blockui.
Related Issues (20)
- onUnblock not called on nth (< 1) use
- Is this project dead? HOT 1
- License Inconsistencies
- Bower install invalid-mta errors HOT 1
- Minified version with bower
- Unable to run Asynchronously with other scripts
- Semantic version
- Refused to apply inline style because it violates the following content security policy directive HOT 1
- block ui does not work on desktop version in safari,chrome and firefox browser
- accessibility support
- Mouse normal HOT 2
- Modal and SweetAlert
- Update the blocked message without re-blocking?
- Listen events 'block' and 'unblock'
- $.blockUI.defaults.message migrate Jquery 1.12 to 3.5
- Safari problems
- demo page HOT 3
- Can't download production version HOT 1
- Jquery Migrate says "isFunction" is deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockui.