$
(
window
).
resize
(
function
()
{
// window dimenstions
var
windowWidth
=
$
(
window
).
width
();
var
windowHeight
=
$
(
window
).
height
();
// figure dimensions
var
figureWidth
=
$
(
'#detailScreen figure'
).
width
();
var
figureHeight
=
$
(
'#detailScreen figure'
).
height
();
// proportions figure/window
var
widthPropWinToBigImg
=
figureWidth
/
windowWidth
;
var
heightPropWinToBigImg
=
figureHeight
/
windowHeight
;
// resize figure according to proportion
$
(
'#detailScreen figure'
).
css
({
'width'
:
figureWidth
*
widthPropWinToBigImg
,
'height'
:
figureHeight
*
heightPropWinToBigImg
,
})
});