views:

57

answers:

1

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 you 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?

+1  A: 

You could use jquery for this:

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