$(function(){ //Set the wrapper to be full screen $(".home #wrapper").css({ height: $(window).height() }) //The navigation //Home $("#nav_link_home").bind("mouseover", function(){ $("#nav_bg").css({ backgroundPosition: "1164px 0" }) }) $("#nav_link_home").bind("mouseout", function(){ nav_out() }) $("#nav_link_home").bind("mousedown", function(){ $("#nav_bg").css({ backgroundPosition: "center top" }) }) /* Gallery items Collect all the gallery items decide what space it needs add the left style ***************************/ gallery_items = $(".gallery_piece") back_btns = $(".back_btn") gap = 100 start_point = 1175// + gap gallery_items.each(function (i) { $(this).css({ left: start_point + "px" }) $(back_btns[i]).css({ position: "absolute", left: start_point + 35 + "px" }) if ($(this).hasClass("gallery_video")) { start_point = start_point - 100 } start_point = $(this).width() + start_point + gap }); }) function nav_out(){ $("#main_nav_img").css({ backgroundPosition: "0 0" }) }