2020年5月11日 星期一

設定div 填滿可用空間,內容不足則出現捲軸

.directive('divwh', function ($timeout) {
        return {
            link: function (scope, elem, attrs) {
                var positioner = function () {
                    var h = $(window).height() - $(elem).offset().top - 5; // 使用最多高度 ,5px 緩衝(考慮捲軸空間)     
                    var w = $(window).width() - 190 - 10;   // 使用最多寬度,左邊預留190px,10px 緩衝(考慮捲軸空間)
                    $(elem).height(h);
                    $(elem).width(w);
                }
                $(window).resize(function () {
                    positioner();
                });
                $timeout(function () {
                    positioner();
                });
            }
        };
    });

沒有留言:

自訂權限驗證機制

// 使用 filter [Route("api/[controller]")] [ApiController] [Authorize] [TypeFilter(typeof(CustomAsyncAuthorizationFilter))] public c...