File: D:/HostingSpaces/SBogers10/ijzerenman.komma.pro/wwwroot/js/app/app.js
define([
'core/history'
],function($history)
{
// Home
if($('body.home').size())
{
var $overlays = $('#banner-overlays');
var $columns = $('#banner-columns');
var $titles = $('#banner-titles');
var $globalNavigation = $('#global-navigation-list');
var $backgrounds = $('#banner-backgrounds');
// Set hover on items in header
$columns.children('li').hover(
function(){ hoverOnIndex($(this).index()); },
function(){ hoveOffIndex($(this).index()); }
);
// Set hover on items in global navigation
$globalNavigation.children('li').hover(
function(){ hoverOnIndex($(this).index()); },
function(){ hoveOffIndex($(this).index()); }
);
function hoverOnIndex(index)
{
// Give li in global navigation a hovered state (class)e
$overlays.children('li').eq(index).addClass('hovered');
$columns.children('li').eq(index).addClass('hovered');
$titles.children('li').eq(index).addClass('show');
$globalNavigation.children('li').eq(index).addClass('hovered');
// Show background
$backgrounds.children('li').eq(index).addClass('show');
}
function hoveOffIndex(index)
{
// Remove hovered state (class)
$overlays.children('li').eq(index).removeClass('hovered');
$columns.children('li').eq(index).removeClass('hovered');
$titles.children('li').eq(index).removeClass('show');
$globalNavigation.children('li').eq(index).removeClass('hovered');
// Hide background
$backgrounds.children('li').eq(index).removeClass('show');
}
}
// Forms
var $formPage = $('.form-page');
if($formPage.size())
{
var $description = $formPage.children('.description');
var $form = $formPage.children('.form-block');
var descriptionHeight = $description.outerHeight();
var formHeight = $form.outerHeight();
// Check which is higher and set the other one to the highest height
if(formHeight > descriptionHeight)
{
$description.css({ height: formHeight+'px'});
}
else
{
$form.css({ height: descriptionHeight+'px'});
}
}
//
});