$(document).ready(function(){ //galery button up fade $('#up').animate({ opacity: 0.05, }, 1, function() { }); var winwidth = $(window).width(); var winheight = $(window).height(); var showInfo = 1; leftmargin = (winwidth - 800) / 2; if(leftmargin>0) { $("#logoContainer").css("margin-left", leftmargin + "px"); $("#menuContainer").css("margin-left", leftmargin + "px"); $("#infoContainer").css("margin-left", leftmargin + "px"); $("#galleryButtons").css("margin-left", leftmargin + 20 + "px"); } else { $("#logoContainer").css("margin-left", "0px"); $("#menuContainer").css("margin-left", "0px"); $("#infoContainer").css("margin-left", "0px"); } $(".email").click( function(event) { $(this).attr("href", "mailto:rummel@bigpond.com?subject=Website Enquiry"); }); // show hide $(".button1").toggle(function () { showInfo = 0; $("#menuContainer").animate({ marginLeft: winwidth-20 }, 800); $("#logoContainer").animate({ marginLeft: winwidth-380 }, 800); $("#infoContainer").animate({ marginLeft: winwidth-20 }, 800); }, function () { showInfo = 1; $("#menuContainer").animate({ marginLeft: leftmargin }, 800); $("#logoContainer").animate({ marginLeft: leftmargin }, 800); $("#infoContainer").animate({ marginLeft: leftmargin }, 800); }); // window resize function $(window).resize(function() { winwidth = $(window).width(); winheight = $(window).height(); leftmargin = (winwidth - 800) / 2; if(leftmargin<0) { $("#logoContainer").css("margin-left", "0px"); $("#menuContainer").css("margin-left", "0px"); $("#infoContainer").css("margin-left", "0px"); $("#galleryButtons").css("margin-left", "20px"); } else if(showInfo==0){ $("#logoContainer").css("margin-left", winwidth - 380); $("#menuContainer").css("margin-left", winwidth - 20); $("#infoContainer").css("margin-left", winwidth - 20); $("#galleryButtons").css("margin-left", winwidth - 20); } else { $("#logoContainer").css("margin-left", leftmargin + "px"); $("#menuContainer").css("margin-left", leftmargin + "px"); $("#infoContainer").css("margin-left", leftmargin + "px"); $("#galleryButtons").css("margin-left", leftmargin + 20 + "px"); } }); //gallery buttons i = 0; itemAmount = $('.item').size(); testCondition = itemAmount -3; $("#down").click( function() { if (i < testCondition) { i++; $(".itemSlider").animate({'top': "-=161px"}, 400); $('#down').animate({ opacity: 0.05, }, 200, function() { }); $('#up').animate({ opacity: 1, }, 200, function() { }); } }); $("#up").click( function() { if (i > 0) { i--; $(".itemSlider").animate({'top': "+=161px"}, 400); $('#up').animate({ opacity: 0.05, }, 200, function() { }); $('#down').animate({ opacity: 1, }, 200, function() { }); } }); $(function() { // Use this example, or... $('a[rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel }); });