惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
雷峰网
雷峰网
博客园 - 叶小钗
V
V2EX
博客园 - Franky
博客园_首页
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
S
SegmentFault 最新的问题
B
Blog RSS Feed
博客园 - 【当耐特】
D
Docker
N
Netflix TechBlog - Medium

博客园 - 重粒子

文件在线预览doc,docx转换pdf(一) vue中集成pdfjs自定义分页 使用 vs code 搭建vue项目(一) post文件下载 css 文本超出2行就隐藏并且显示省略号 js监听全屏下的esc事件 js实现全屏和缩放 ionic 侧栏菜单用法 weblogic获取应用目录路径(war包) 使用pdf.js预览实现读取服务器外部文件 js禁用浏览器后退 java批量将多文件打包成zip格式 AngularJS封装webupload实现文件夹上传 jquery监听滚动条 pdf预览(pdf.js) (钉钉)第三方WEB网站扫码登录 $q的基本用法 Jersey RESTful WebService框架学习(八)文件下载防乱码 巧用 Jersey RESTful WebService框架解决文件上传乱码
Angularjs自定义指令计算浏览器高度
重粒子 · 2018-03-27 · via 博客园 - 重粒子
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>柳絮飞祭奠</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/APP-INF/plugins/angular/angular.js"></script>
</head>
<body>

<div lx-ui-auto="" height-remove="10" style="background-color: red;"></div>
</body>
<script type="text/javascript">
	var app=angular.module("app",[]);
 
	/**
	 * height-remove 设置窗口高度需要移除的高度值,如移除顶部导航高度50
	 * height-tag    设置是按height还是min-height设置高度值,height才会出现滚动条。
	 */
	app.directive('lxUiAuto', function($window) {
		return {
			restrict : 'A',
			scope : {},
			link : function($scope, $element, $attrs) {
				if($attrs.heightTag==undefined){
					$element.css("min-height", ($window.innerHeight-$attrs.heightRemove) + 'px');
				}else{
					$element.css($attrs.heightTag, ($window.innerHeight-$attrs.heightRemove) + 'px');
				}
			}
		};
	});
</script>
</html>

效果: