dynamically determine window

49 views
Skip to first unread message

Candyman

unread,
Nov 3, 2011, 6:34:02 PM11/3/11
to easybox-discuss
I've been trying to use the standard text:

<script type="application/json" id="easyOptions">
{
"lightbox-iframe": {
"defWidth": 320,
"defHeight": 240
}
}
</script>


And change how large the window is and change it to dynamically
display for how large the users window is so it always shows correctly
if they are on a desktop, ipad or phone:

<script type="application/json" id="easyOptions">
{
"lightbox": {
"defWidth": (parseInt(screen.availWidth) - 50),
"defHeight": (parseInt(screen.availHeight) - 50)
}
}
</script>


But i can't get this to work. Have I messing up the JavaScript or
will this just not work? Any help would be appreciated.
Message has been deleted

Vincent

unread,
Nov 29, 2011, 1:03:41 PM11/29/11
to easybox...@googlegroups.com
Hi there

This is not JavaScript, this is JSON and is dynamically parsed by jQuery.

Instead, look at the
maxScreenFill option here:
http://code.google.com/p/easybox/wiki/ChangeOptions

You can set this to like 0.8 and it keeps ratio of the content and dynamically shrinks the content to screen size.
Reply all
Reply to author
Forward
0 new messages