我找不到如何做到这一点:(有gtk_window_set_resizable,但它会禁用调整大小,我仍然希望我的窗口水平调整大小.任何想法?
我正在开发响应式布局,我也在使用JQuery Masonry.
我正在使用以下脚本来获取当前列宽.
var curWidth;
var detector;
detector = $('.magic-column');
curWidth = detector.outerWidth(true);
$(window).resize(function(){
if(detector.outerWidth(true)!=curWidth){
curWidth = detector.outerWidth(true);
}
});
Run Code Online (Sandbox Code Playgroud)
我的JQuery Masonry init脚本是这样的..
$(window).load(function(){
$(function (){
$wall.masonry({
singleMode: true,
columnWidth: curWidth, // This needs to be update on window load & resize both //
});
});
});
Run Code Online (Sandbox Code Playgroud)
我的第一个脚本是正确获取宽度,但在砌体中宽度没有更新...我如何实现加载和调整大小功能,以便我的curWidth将更新为Masonry以及窗口调整大小
我们创造了一个非常基本的相等高度功能,而后卫效果很好.但是,我们的任务是在调整窗口大小时调整列高度.它被实现为响应式,流畅的设计.但是那些不明白典型的响应用例并没有将你的浏览器拖到整个地方以接受特定断点的权力.
无论如何,在这里得到jsfiddle的标记和js设置.http://jsfiddle.net/J6uaH/3/
只是不能完全包围我的大脑将窗口调整大小元素添加到高度.任何人都可以提供的帮助将非常感激,如果有这样的事情,会给予超级英雄奖励积分!
我刚刚发布这个小提琴,认为它可能对像我这样的人有帮助.它显示了如何将普通的javascript传递给角度范围.在这种情况下,范围获取窗口内部化信息.
http://jsfiddle.net/spacm/HeMZP/
为了个人使用,我将传递给角度范围这些信息:
使用navigator.platform变量
function isInIFrame(){
return window.location !== window.parent.location;
}
function updateMediaInfoWH() {
if((typeof(mediaInfo.inIFrame)!='undefined') && (!mediaInfo.inIFrame)) {
mediaInfo.width = innerWidth;
mediaInfo.height = innerHeight;
updateMediaInfoOrientation();
}
tellAngular();
}
function tellAngular() {
console.log("tellAngular");
var domElt = document.getElementById('mainContainer');
scope = angular.element(domElt).scope();
console.log(scope);
scope.$apply(function(){
scope.mediaInfo = mediaInfo;
scope.info = mediaInfo.width;
});
}
Run Code Online (Sandbox Code Playgroud)
欢迎任何评论.
我有一个需要调整大小的无边界 winForm,我设法这样做:
protected override void WndProc(ref Message m)
{
const int wmNcHitTest = 0x84;
const int htLeft = 10;
const int htRight = 11;
const int htTop = 12;
const int htTopLeft = 13;
const int htTopRight = 14;
const int htBottom = 15;
const int htBottomLeft = 16;
const int htBottomRight = 17;
if (m.Msg == wmNcHitTest)
{
Console.Write(true + "\n");
int x = (int)(m.LParam.ToInt64() & 0xFFFF);
int y = (int)((m.LParam.ToInt64() & 0xFFFF0000) >> 16);
Point pt = PointToClient(new …Run Code Online (Sandbox Code Playgroud) 在过去的几天里,我试图在我的 blazor 应用程序中读出浏览器分辨率。我尝试这样做:[JSInvokable] Blazor Methode 由 JS 脚本调用。
1.我的问题是:宽度和高度仅在我重新加载(手动刷新)页面后显示在我的blazorpage中。我无法调用 this.StateHasChanged() 因为我的方法是静态的。
我如何调用 StateHasChanged 或者我需要做什么才能显示新数据?我对 ASP.net 等还很陌生,所以如果可能的话请包含一个代码示例;)
这是我的 Code blazor (服务器端)代码:
@page "/"
@inject IJSRuntime jsRuntime
<h1>Window Dimensions</h1>
<p>Window Width: @Width</p>
<p>Window Height: @Height</p>
<p>@DebugString</p>
@code {
public static int Width;
public static int Height;
public static string DebugString;
[JSInvokable]
public static async Task GetBrowserDimensions(int width, int height)
{
Width = width;
Height = height;
if (Width < 600)
{
DebugString = "small_UI";
}
if (Width >= 600)
{
DebugString = …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 MAUI 作为 Windows 应用程序,该应用程序需要在从宽屏幕到平板电脑的多种屏幕尺寸上工作,并允许调整窗口大小。
我需要能够检测窗口调整大小事件,并根据窗口的大小有条件地显示输出。例如,在宽屏幕上显示完整网格,但在较小屏幕上显示卡片。
SizeChanged我已经实现了MAUI 应用程序(https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/app-lifecycle )的一个事件,可以在应用程序级别记录更改。
using Microsoft.Maui.LifecycleEvents;
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureLifecycleEvents(events =>
{
#if WINDOWS
events.AddWindows(windows => windows
.OnWindowCreated(window =>
{
window.SizeChanged += OnSizeChanged;
}));
#endif
});
return builder.Build();
}
#if WINDOWS
static void OnSizeChanged(object sender, Microsoft.UI.Xaml.WindowSizeChangedEventArgs args)
{
ILifecycleEventService service = MauiWinUIApplication.Current.Services.GetRequiredService<ILifecycleEventService>();
service.InvokeEvents(nameof(Microsoft.UI.Xaml.Window.SizeChanged));
}
#endif
Run Code Online (Sandbox Code Playgroud)
但是我如何将其链接到单独的 MAUI 页面,以便我可以适当地检测新的窗口大小和布局?
任何建议或更好的解决方案将不胜感激
在 Windows 上的 Flet 中,我正在运行 calc 演示并尝试修改 Python 中应用程序窗口的属性。
如何在代码中更改 Flet 窗口的大小并指定用户不能调整其大小?
(理想情况下,这篇文章应该带有“Flet”标签,但该标签尚不存在,因为该项目还处于起步阶段,而且我没有创建它所需的 1500 点。)
有没有办法pageLength在jQuery的"window.resize"事件中更改运行时dataTable 的设置?
这些是我正在使用的dataTable设置
$('#dataTable').DataTable({
paging: true,
pageLength: 35,
searching: true,
lengthChange: false,
info: false,
scrollCollapse: true,
scrollY: "calc(74vh)"
});
Run Code Online (Sandbox Code Playgroud)
pageLength每当窗口调整大小时,我希望更改.
我正在尝试这个
$(window).resize(function () {
if ($(this).height() >= "1080"){
// change the dataTable pageLength in here
$('#dataTable').DataTable({ pageLength: 50 });
} else {
// default pageLength
$('#dataTable').DataTable({ pageLength: 35 });
}
});
Run Code Online (Sandbox Code Playgroud) 在 Delphi 10.4 VCL 应用程序中,我需要检测 FORM RESIZING ENDS何时结束。(例如,在用户通过拖动其尺寸夹点来调整表单大小之后)。
TApplicationEvents因此,我在表单上放置了一个组件并创建了其OnMessage事件处理程序,试图捕获消息WM_EXITSIZEMOVE:
procedure TformMain.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
begin
if (Msg.Message = WM_EXITSIZEMOVE) then
begin
CodeSite.Send('TformMain.ApplicationEvents1Message: WM_EXITSIZEMOVE');
end;
end;
Run Code Online (Sandbox Code Playgroud)
但调整窗体大小后,事件处理WM_EXITSIZEMOVE程序不会执行。
那么我如何检测表单调整大小结束,也许通过使用 TApplicationEvents 组件?
window-resize ×10
jquery ×3
c# ×2
javascript ×2
window ×2
angularjs ×1
blazor ×1
borderless ×1
c ×1
datatable ×1
datatables ×1
delphi ×1
flutter ×1
forms ×1
gtk ×1
maui ×1
python ×1
resize ×1