jQuery(document).ready(function(e) { jQuery(".post-container").hover(function(){ jQuery(this).find(".title-shadow").toggle(); },function(){ jQuery(this).find(".title-shadow").toggle(); }); jQuery(".load-more").click(function(e){ e.preventDefault(); jQuery(".load-more").hide(); jQuery("hr").hide(); var target = jQuery(this).attr('href'); jQuery.get(target, function(data){ jQuery(data).find(".content-container").appendTo(".content-container"); }); }); jQuery(".nav-menu").click(function(){ jQuery(".menu-items-ul").toggle(); }); if(jQuery("#gallery").length){ // Declare variables var totalImages = jQuery("#gallery > li > img").length, imageWidth = jQuery("#gallery > li > img:first").outerWidth(true), totalWidth = imageWidth * totalImages, visibleImages = Math.round(jQuery(".framesholder").width() / (imageWidth + 5)), visibleWidth = visibleImages * imageWidth, stopPosition = (visibleWidth - totalWidth) imgmargin = parseInt(jQuery("#gallery > li:first").css("margin-left"),10), skipitems = 3; jQuery("#gallery").width(totalWidth); jQuery(".arrow-left").click(function(){ if(jQuery("#gallery").position().left < 0 && !jQuery("#gallery").is(":animated")){ jQuery("#gallery").animate({left : "+=" + (skipitems * (imageWidth + imgmargin)) + "px"}); } return false; }); jQuery(".arrow-right").click(function(){ if(jQuery("#gallery").position().left > stopPosition && !jQuery("#gallery").is(":animated")){ jQuery("#gallery").animate({left : "-=" + (skipitems * (imageWidth + imgmargin)) + "px"}); } return false; }); jQuery(".next-image").click(function(){ if(jQuery("#displayedimg").next(jQuery(".post-image-item")).length){ var displayeditem = jQuery("#displayedimg").next(jQuery(".post-image-item")); }else{ var displayeditem = jQuery(".post-image-item:first"); } jQuery(".post-image-item").fadeOut(); jQuery(".post-image-item").attr("id",""); jQuery(displayeditem).attr("id","displayedimg"); jQuery(displayeditem).fadeIn("slow"); }); jQuery(".previous-image").click(function(){ if(jQuery("#displayedimg").prev(jQuery(".post-image-item")).length){ var displayeditem = jQuery("#displayedimg").prev(jQuery(".post-image-item")); }else{ var displayeditem = jQuery(".post-image-item:last"); } jQuery(".post-image-item").fadeOut(); jQuery(".post-image-item").attr("id",""); jQuery(displayeditem).attr("id","displayedimg"); jQuery(displayeditem).fadeIn("slow"); }); jQuery(".play-pause").click(function(){ if(jQuery(".play-pause").attr("id")=="pp-pause"){ clearInterval(timer); jQuery(".play-pause").attr("id", "pp-play"); }else{ timer = window.setInterval(sliderplay, 3000); jQuery(".play-pause").attr("id", "pp-pause"); } }); jQuery(".frame-img").click(function(){ var tid = jQuery(this).attr("tid"); jQuery(".post-image-item").fadeOut(); jQuery(".post-image-item").attr("id",""); jQuery(".post-image-item[tid='" + tid + "']").attr("id","displayedimg"); jQuery(".post-image-item[tid='" + tid + "']").fadeIn(); }); function sliderplay(){ if(jQuery("#displayedimg").next(jQuery(".post-image-item")).length){ var displayeditem = jQuery("#displayedimg").next(jQuery(".post-image-item")); }else{ var displayeditem = jQuery(".post-image-item:first"); } jQuery(".post-image-item").fadeOut(); jQuery(".post-image-item").attr("id",""); jQuery(displayeditem).attr("id","displayedimg"); jQuery(displayeditem).fadeIn("slow"); } var scrheight = jQuery(window).height() - 100; var scrwidth = jQuery(window).width(); jQuery(".post-image-item").css("max-height", scrheight + "px"); jQuery(".post-image-item").css("max-width", scrwidth + "px"); jQuery(".post-image-item:first").attr("id","displayedimg"); jQuery(".post-image-item:first").fadeIn(); jQuery(".play-pause").attr("id", "pp-pause"); var timer = 0; timer = window.setInterval(sliderplay, 3000); } if(jQuery(".film-roll").length){ jQuery(document).mousemove(function(e){ var relpos = e.pageY / jQuery(window).height(); if(relpos > 0.70 ){ jQuery(".film-roll").show("slow"); }else{ jQuery(".film-roll").hide("slow"); } }); } });