$(function() { $('.sliding-buttons').click(slidingOpen); }); $(function() { $('.close-me').click(slidingClose); }); $(function() { $('.letmeclick').click(propCheck); }); $(function() { $('a.bigButton').click(stopProp); }); $(function() { $('a.reelclick').click(galleryclick); }); function slidingOpen(e) { var boxID = $(this).attr('id'), boxName = $(this).attr('name'); $('.sliding-holder#s-h-' + boxName).css({'display' : 'block'}).addClass('open'); $('.sliding-content#s-c-' + boxName + '-' + boxID).css({'display' : 'block'}).addClass('open'); $('.sliding-box#s-b-' + boxName).stop(true, true).animate({ top:'0' },'slow'); e.stopPropagation(); e.preventDefault(); } function slidingClose(e) { var boxName = $(this).attr('name'); $('.sliding-box#s-b-' + boxName).stop(true, true).animate({ top:'710' },'slow', function() { $('.sliding-content.open').css({'display' : 'none'}).removeClass('open'); $('.sliding-holder.open').css({'display' : 'none'}).removeClass('open'); }); e.stopPropagation(); e.preventDefault(); } function propCheck(e){ window.open( $(this).attr('href') ); e.stopPropagation(); e.preventDefault(); } function stopProp(e) { e.stopPropagation(); e.preventDefault(); } function galleryclick(e) { e.stopPropagation(); e.preventDefault(); return false; } function scrollToSlide(id){ if ($('a.scroll').hasClass('current')) { $('a.scroll.current').removeClass('current'); }; $('html,body').animate({scrollTop: $("."+id).offset().top},'slow'); $('a.scroll#menu-' + id).addClass('current'); } function resizeImagesAndSlides() { var h = $(window).height(), w = $(window).width(), fixHeight = h * 0.35, bigBtnOHeight = $('a.bigButton').height(), bigBtnOWidth = $('a.bigButton').width(), bigBtnNHeight = h * 0.35, ratioChange = fixHeight / bigBtnOHeight, bigBtnNWidth = bigBtnOWidth * ratioChange, qlinkxWidth = (bigBtnNWidth * 3)+20, qlinkxMarginLeft = qlinkxWidth / 2, qlinkxBottom = h * 0.1; $('.bigButton').css({'width' : bigBtnNWidth.toFixed(0), 'height' : bigBtnNHeight.toFixed(0)}); $('#quick-links-holder').css({'width' : qlinkxWidth.toFixed(0), 'left' : '50%', 'margin-left' : -qlinkxMarginLeft.toFixed(0)}).fadeIn(); $('.slide') .css({'height': (($(window).height()) )}); } $(window).load(function() { resizeImagesAndSlides(); }); $(window).resize(function() { resizeImagesAndSlides(); });