// get the value of the bottom of the #main element by adding the offset of that element plus its height, set it as a variable function attachHandler(jQuery) { $('#obscure_header').css('height', ($('#photo_header').height())); $('#obscure_header_mobile').css('height', ($('#photo_header_mobile').height())); $('#obscure_subscribe').css('height', ($('#photo_subscribe').height())); $('#obscure_subscribe2').css('height', ($('#photo_subscribe2').height())); $('#myCarousel.carousel.slide').css('height', ($('#photo_header').height())); $('#myCarousel2.carousel.slide').css('height', ($('#photo_header_mobile').height())); $('#tagline_header').css('top', (($('#photo_header').height()/7)*-5)); $('#tagline_header_mobile').css('top', (($('#photo_header_mobile').height()/10)*-8)); $('#tagline_subscribe').css('top', (($('#photo_subscribe').height()/10)*-8)); $('#tagline_subscribe2').css('top', (($('#photo_subscribe2').height()/10)*-7)); $(window).on('load',function(){ $('#obscure_header').css('height', ($('#photo_header').height())); $('#obscure_header_mobile').css('height', ($('#photo_header_mobile').height())); $('#obscure_subscribe').css('height', ($('#photo_subscribe').height())); $('#obscure_subscribe2').css('height', ($('#photo_subscribe2').height())); $('#myCarousel.carousel.slide').css('height', ($('#photo_header').height())); $('#myCarousel2.carousel.slide').css('height', ($('#photo_header_mobile').height())); $('#tagline_header').css('top', (($('#photo_header').height()/7)*-5)); $('#tagline_header_mobile').css('top', (($('#photo_header_mobile').height()/10)*-8)); $('#tagline_subscribe').css('top', (($('#photo_subscribe').height()/10)*-8)); $('#tagline_subscribe2').css('top', (($('#photo_subscribe2').height()/10)*-7)); }); $(window).on('ready',function(){ $('#obscure_header').css('height', ($('#photo_header').height())); $('#obscure_header_mobile').css('height', ($('#photo_header_mobile').height())); $('#obscure_subscribe').css('height', ($('#photo_subscribe').height())); $('#obscure_subscribe2').css('height', ($('#photo_subscribe2').height())); $('#myCarousel.carousel.slide').css('height', ($('#photo_header').height())); $('#myCarousel2.carousel.slide').css('height', ($('#photo_header_mobile').height())); $('#tagline_header').css('top', (($('#photo_header').height()/7)*-5)); $('#tagline_header_mobile').css('top', (($('#photo_header_mobile').height()/10)*-8)); $('#tagline_subscribe').css('top', (($('#photo_subscribe').height()/10)*-8)); $('#tagline_subscribe2').css('top', (($('#photo_subscribe2').height()/10)*-7)); }); var mainbottom = $('#myCarousel').height(); $( window ).resize(function(){ $('#obscure_header').css('height', ($('#photo_header').height())); $('#obscure_header_mobile').css('height', ($('#photo_header_mobile').height())); $('#obscure_subscribe').css('height', ($('#photo_subscribe').height())); $('#obscure_subscribe2').css('height', ($('#photo_subscribe2').height())); $('#myCarousel.carousel.slide').css('height', ($('#photo_header').height())); $('#myCarousel2.carousel.slide').css('height', ($('#photo_header_mobile').height())); var mainbottom = $('#myCarousel').offset().top + ($('#myCarousel').height()*2)-10; $('#tagline_header').css('top', (($('#photo_header').height()/7)*-5)); $('#tagline_header_mobile').css('top', (($('#photo_header_mobile').height()/10)*-8)); $('#tagline_subscribe').css('top', (($('#photo_subscribe').height()/10)*-8)); $('#tagline_subscribe2').css('top', (($('#photo_subscribe2').height()/10)*-7)); }); $('.popup').popover('toogle') // Newsletter Subscription AJAX $('.new_subscription').submit(function() { var valuesToSubmit = $(this).serialize(); $.ajax({ type: "POST", url: $(this).attr('action'), data: valuesToSubmit, dataType: "json", async: true, error: function(request, textStatus, errorThrown){ msg = '