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/SBogers75/roost-interieurbouw.nl/wwwroot/js/main.js
/**
 * Created by Pascal on 30/09/15.
 */
$(function() {
    window.onbeforeunload = function(){  //makes the start position of the website at the top.
        window.scrollTo(0,0);
    }

    $('.main-content').css('margin-top', ($(window).height()/1.8)); //calculates where the content must start

    $('.logo').click(function(){
        window.location = '/';
    });
    $('.company').click(function(){
        window.location = '/';
    });

    $('.submit').click(function(){
       //console.log('submit');
        $('#contactForm').submit();

    });


    resizing();


    $(window).resize(function(){
        resizing();
    });

    $('a.internal-link').click(function(){   //internal link animate
        if($.attr(this, 'href')=='#home'){
            $('html, body').animate({
            scrollTop: 0
            }, 1000);
        }
        else {
            $('html, body').animate({
                scrollTop: ($($.attr(this, 'href')).offset().top) - 150
            }, 1000);
        }
        return false;
    });

    jQuery.each(jQuery('textarea[data-autoresize]'), function() {  //autosize TextArea
        var offset = this.offsetHeight - this.clientHeight;

        var resizeTextarea = function(el) {
            jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset);
        };
        jQuery(this).on('input', function() { resizeTextarea(this); });
    });

});

function resizing(){
    $( ".product" ).height($( ".product").width()/16*9);
}