HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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'
            });
        }
    }
});