dio-v
12/2/2015 - 7:00 AM

schuine randen require: throttle2

schuine randen require: throttle2

/* slopes */
.slope-bottom-subtract-wrap{ /*haalt schuin gedeelte van onderkant content af*/
    position:relative;
    overflow:hidden;
    &:before{
        content:'';
        width:6000px;
        height:1000px;
        background-color:#FFF;
        display:block;
        position:absolute;
        left:0;
        bottom:-842px;
        .transform(skew(0deg, -3deg));
        z-index:999;
    }
}

.slope-top-add-wrap{ /*voegt schuin gedeelte aan bovenkant toe*/
    position:relative;
    overflow:hidden;
    height:0;
    &:before{
        content:'';
        width:6000px;
        height:1000px;
        background-color:#FFF;
        display:block;
        position:absolute;
        right:0;
        top:-842px;
        .transform(skew(0deg, -3deg));
        z-index:999;
    }
}

.slope-top-subtract-wrap{ /*haalt schuin gedeelte van bovenkant content af*/
    position:relative;
    overflow:hidden;
    &:before{
        content:'';
        width:6000px;
        height:1000px;
        background-color:#FFF;
        display:block;
        position:absolute;
        right:0;
        top:-842px;
        .transform(skew(0deg, -3deg));
        z-index:999;
    }
}

.slope-grey:before{
    background-color:@secondary-colorB2;
}

.slope-line-blue:before{
    border-top:4px solid #005ebc;
    bottom:-838px;
}
/* end slopes */
    //slope-bottom-subtract
    $('.slope-bottom-subtract').each(function () {
        var vT = $(this);
        var vClass = '';
        if (vT.data('slope-class') !== undefined) {
            vClass = vT.data('slope-class');
        }
        vT.wrap('<div class="slope-bottom-subtract-wrap ' + vClass + '" />');
    });


    //slope-top-subtract
    $('.slope-top-subtract').each(function () {
        var vT = $(this);
        var vClass = '';
        if (vT.data('slope-class') !== undefined) {
            vClass = vT.data('slope-class');
        }
        vT.wrap('<div class="slope-top-subtract-wrap ' + vClass + '" />');
    });

    //slope-top-add
    $('.slope-top-add').each(function () {
        var vT = $(this);
        var vClass = '';
        if (vT.data('slope-class') !== undefined) {
            vClass = vT.data('slope-class');
        }
        vT.prepend('<div class="slope-top-add-wrap ' + vClass + '" />');
        fixSlope();
    });



    $(window).bind("resize orientationchange", throttle2(function () {
            fixSlope();
    },200));
    
function fixSlope() {
    $('.slope-top-add-wrap').each(function () {
        var vT = $(this);
        vT.stop(true,true).animate({ 'height': (vT.width() / 18) + 'px' });
    });
}