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();
精彩评论