$(function() { $("div.social > div a.over").off("mouseover").off("mouseout"); $(document).on("mouseover", "#address address a.over", function(){ $(this).parent().css({ "background-image" : "url(http://leofujisawa.com/elements/btn_utility.png?210414)" }); $(this).stop().animate({ "opacity" : 0 }, 10); }); $(document).on("mouseout", "#address address a.over", function(){ $(this).stop().animate({ "opacity" : 1 }, 500, function(){ $(this).parent().css({"background-image" : "none"}); }); }); $(document).on("mouseover", "#address div a.over", function(){ $(this).parent().css({ "background-image" : "url(http://leofujisawa.com/elements/btn_utility.png?210414)" }); $(this).stop().animate({ "opacity" : 0 }, 10); }); $(document).on("mouseout", "#address div a.over", function(){ $(this).stop().animate({ "opacity" : 1 }, 500, function(){ $(this).parent().css({"background-image" : "none"}); }); }); $(document).on("mouseover", "#entry div.social > div a.over", function(){ $(this).parent().css({ "background-image" : "url(http://leofujisawa.com/elements/btn_social_large.png)" }); $(this).stop().animate({ "opacity" : 0 }, 10); }); $(document).on("mouseout", "#entry div.social > div a.over", function(){ $(this).stop().animate({ "opacity" : 1 }, 500, function(){ $(this).parent().css({"background-image" : "none"}); }); }); $(document).on("click", "aside.top_info a.pjax", function(){ var scrollto = $("#container").offset().top - 80; $('html,body').stop().animate({ scrollTop: scrollto }, 1000, "easeOutQuint"); }); LOADMORE_loadmore_flag = false; function LOADMORE_initialize(LOADMORE_index_i){ var LOADMORE_set_index_count_i = LOADMORE_index_i; LOADMORE_thumb_i_max = $("div#index > article > ul > li.thm").length; thmArr = []; LOADMORE_thumb_i = 0; $("div#index > article > ul > li.thm").each(function(){ thmArr.push($(this)); LOADMORE_thumb_i ++; }); LOADMORE_index_thumbs_fade(LOADMORE_set_index_count_i); } y = 0; prev_y = 0; vertical_align = ""; function LOADMORE_index_thumbs_fade(LOADMORE_set_index_count_i) { var i = LOADMORE_set_index_count_i; if( i < LOADMORE_thumb_i ){ thmArr[i].find(".img > *").imagesLoaded(function(){ if( thmArr[i].is(".on") ){ thmArr[i].stop().animate({opacity:"1"},400); var ua = navigator.userAgent; var isIE8 = ua.match(/msie [8.]/i); if( isIE8 ){ thmArr[i].find("figure *[class != 'text_wrapper']").animate({"opacity":1},200); } }else{ thmArr[i].stop().animate({opacity:"0.1"},400); var ua = navigator.userAgent; var isIE8 = ua.match(/msie [8.]/i); if( isIE8 ){ thmArr[i].find("figure *[class != 'text_wrapper']").animate({"opacity":0.1},200); } } setTimeout(function(){ i++; LOADMORE_index_thumbs_fade(i); },100); }); }else{ LOADMORE_loadmore_flag = true; $("li.load_more").fadeIn(300); } } function LOADMORE_loadmore_index( id, index_count_i, index_count_limit, href ){ $("li.load_more > a > div").fadeOut(300).remove(); $.ajax({ url: "http://leofujisawa.com/ajax_index_load.php", data: "id=" + id + "&index_count_i=" + index_count_i + "&index_count_limit=" + index_count_limit + "", success: function(data, dataType){ $("div#index .load_more").remove(); $("div#index > article > ul").append( data ); LOADMORE_initialize(index_count_i); }, complete: function(XMLHttpRequest, textStatus){ }, error: function(XMLHttpRequest, textStatus, errorThrown){ } }); } $(window).bind('load', function() { setTimeout(function(){ LOADMORE_initialize(0); },100); }); $(document).on("click", ".load_more > a", function(){ if( LOADMORE_loadmore_flag == true ){ LOADMORE_loadmore_flag = false; var id = $(this).attr("data-id"); var index_count_i = $(this).attr("data-index_count_i"); var index_count_limit = $(this).attr("data-index_count_limit"); var href = $(this).attr("href").replace( "http://leofujisawa.com/", "" ); LOADMORE_loadmore_index( id, index_count_i, index_count_limit, href ); } return false; }); $(window).scroll(function(){ var window_height = $(window).height(); var scroll_val = $(window).scrollTop(); if( LOADMORE_loadmore_flag == true && $("li.load_more > a > div").length ){ var target = $(".load_more > a"); var margin = 500; var load_more_top = target.offset().top; if( scroll_val > load_more_top - window_height - margin ){ var id = target.attr("data-id"); var index_count_i = target.attr("data-index_count_i"); var index_count_limit = target.attr("data-index_count_limit"); var href = target.attr("href").replace( "http://leofujisawa.com/", "" ); LOADMORE_loadmore_flag = false; LOADMORE_loadmore_index( id, index_count_i, index_count_limit, href ); } } }); function SLIDE_fullscreen_initialize(){ SLIDE_fullscreen_start_flag = "false"; SLIDE_fullscreen_repeat_flag = "true"; SLIDE_fullscreen_repeat_limit = 0; SLIDE_fullscreen_repeat_limit_max = 1000; SLIDE_fullscreen_set_pagewrap_width = 0; SLIDE_fullscreen_create_img_i = 0; SLIDE_fullscreen_preload_i = 0; SLIDE_fullscreen_past_i = -1; SLIDE_fullscreen_timer_id_B = "false"; SLIDE_fullscreen_imgHEIGHT = 0; SLIDE_fullscreen_imgWIDTH = 0; SLIDE_fullscreen_create_img(); $(window).bind("resize", SLIDE_fullscreen_resizeContainer); SLIDE_fullscreen_resizeContainer(); } function SLIDE_fullscreen_control_show( set_interval ){ if( SLIDE_fullscreen_timer_id_B != "false" ){ clearInterval( SLIDE_fullscreen_timer_id_B ); } $("#SLIDE_fullscreen .controller:not(:animated)").animate({ opacity: 1 }, 400, function() { SLIDE_fullscreen_timer_id_B = setInterval( SLIDE_fullscreen_control_hide, set_interval); } ); } function SLIDE_fullscreen_control_hide(){ $("#SLIDE_fullscreen .controller:not(:animated)").animate({ opacity: 0.4 }, 400 ); clearInterval( SLIDE_fullscreen_timer_id_B ); } $("#wrapper").mousemove(function(e){ SLIDE_fullscreen_control_show( 2000 ); }); $(document).on("click", "#SLIDE_fullscreen_thumbs_wrapper a", function(){ SLIDE_fullscreen_create_img_i = $(this).attr("id").replace("SLIDE_fullscreen_", ""); SLIDE_fullscreen_create_img(); }); $(document).on("mouseover", "#SLIDE_fullscreen_thumbs_wrapper a.over", function(){ $(this).stop().animate({ "opacity" : 0.5 }, 10); }); $(document).on("mouseout", "#SLIDE_fullscreen_thumbs_wrapper a.over", function(){ $(this).stop().animate({ "opacity" : 1 }, 500); }); function SLIDE_fullscreen_create_img(){ if( SLIDE_fullscreen_past_i != SLIDE_fullscreen_create_img_i ){ $("#SLIDE_fullscreen_thumbs_wrapper a").css({"color": "#333"}).css({"cursor": "pointer"}).addClass("over"); $("#SLIDE_fullscreen_thumbs_wrapper a#SLIDE_fullscreen_" + SLIDE_fullscreen_create_img_i).css({"color": "#CCC"}).css({"cursor": "default"}).removeClass("over"); var imgURL = SLIDE_fullscreen_media_array[ SLIDE_fullscreen_create_img_i ][0]; var past_set_img_div = "img_div_" + SLIDE_fullscreen_past_i; var past_target = $("div#" + past_set_img_div); SLIDE_fullscreen_past_i = SLIDE_fullscreen_create_img_i; SLIDE_fullscreen_set_img_div = "img_div_" + SLIDE_fullscreen_create_img_i; $("#SLIDE_fullscreen #main").append("