我特林从我的HTML页面中调用一个函数getWidth(heading)
并将其设置为可变width
如下:调用的HTML功能,并将其设置为可变
HTML页面:
div> style="white-space: nowrap; text-overflow: ellipsis; width:{{getWidth(heading)}}px; overflow: hidden; max-height:48px;" data-ng-bind="$eval('row.' + heading.key) | formatter:heading.format" title="{{$eval('row.' + heading.key) | formatter:heading.format}}">
功能:
$scope.getWidth = function(heading){
return document.getElementById($scope.tableId).scrollWidth*heading.width/100 - 24;
};
我添加了一个卷发braces..Chrome功能是计算宽度,但在IE11的方式,该功能不起作用。有人可以请帮忙吗?
Java不是JavaScript的。 – Turing85
实现绑定不是香草的JavaScript。鉴于$ scope的使用,我猜这是Angular 1还是2? – Fallenreaper