|
如下图所示,不能完全停靠在最低部,搞不懂什么鬼。
我看了一下popover.js,在154行位置有个var borderSize = 30;搞不明白,这个borderSize是什么??
具体的代码是这样的
- var borderSize = 30;
- switch(this.position){
- case 'center':
- this.$content.css({
- 'margin-left': -(Math.min(this.$content.width(),ww))/2,
- 'margin-top': -(Math.min(this.$content.height(),wh))/2,
- top: '50%',
- left: '50%',
- right: 'auto',
- bottom: 'auto',
- 'max-height': wh-borderSize
- });
- break;
- case 'bottom':
- this.$content.css({
- 'margin-left': -(Math.min(this.$content.width(),ww))/2,
- top: 'auto',
- left: '50%',
- right: 'auto',
- bottom: borderSize,
- 'max-height': wh-borderSize
- });
- break;
- case 'left':
- this.$content.css({
- 'margin-top': -(Math.min(this.$content.height(),wh)) / 2,
- 'margin-left': 0,
- top: '50%',
- left: borderSize,
- right: 'auto',
- bottom: 'auto',
- 'max-height': wh-borderSize
- });
- break;
- case 'right':
- this.$content.css({
- 'margin-top': -(Math.min(this.$content.height(),wh)) / 2,
- 'margin-left': 0,
- top: '50%',
- left: 'auto',
- right: borderSize,
- bottom: 'auto',
- 'max-height': wh-borderSize
- });
- break;
- default:
- this.$content.css({
- 'margin-left': -(Math.min(this.$content.width(),ww)) / 2,
- top: borderSize,
- left: '50%',
- right: 'auto',
- bottom: 'auto',
- 'max-height': wh-borderSize
- });
- break;
- }
复制代码
|
|