File: D:/HostingSpaces/SBogers96/smilefotografie.nl/wwwroot/js/app/modules/ratio.js
/**
* Make div fixed / unfixed
*/
define('modules/ratio',[],function()
{
/**
* Global variable that represents the object
*/
var ratioModule;
/**
* This is the placeholder that decides the
* size and position of the fixed element
*
* @type {*|jQuery|HTMLElement}
*/
var $container = $('.ratio');
return {
/**
* Set fixable object
*/
init : function()
{
ratioModule = this;
// Check resize once
ratioModule.resize();
},
/**
* Handle resize
*/
resize : function()
{
// Get dimensions
var width = $container.width();
var height = width * 2 / 3; // Todo: data-ratio
// Keep size container
$container.css({
height: height + 'px'
});
}
}
});