开发者

Adjusting JS modal dialog to the browser window size

I wire up Shadowbox dialog provider to my links or button like this:

    <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, "Edit", Model.ContentType.ToString(),
                                                  new {slug = Model.Slug, modal = true},
                                                  new
                                                    {
                                                        rel = "shadowbox;height=600;width=700",
                                                        title = Resources.Localize.Routes_WidgetsEdit,
                                                        @class = "editWidget"
                                                    })%>

As y开发者_如何学Cou can see, the values for dialog size are hardcoded. I want to have those two values dependant on the current size of the browser window but not entirely. I would like them to be like 80% or 90% percent.

How can I calculate this in JavaScript?


You could use jquery for this:

$(window).width();
$(window).height();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜