$(function() { $("div.social > div a.over").off("mouseover").off("mouseout"); $(document).on("mouseover", "#footer div.social > div a.over", function(){ $(this).parent().css({ "background-image" : "url(https://www.studiokuplus.com/elements/btn_social.png)" }); $(this).stop().animate({ "opacity" : 0 }, 10); }); $(document).on("mouseout", "#footer div.social > 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(https://www.studiokuplus.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"}); }); }); 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; LOADMORE_thmArr = []; LOADMORE_thumb_i = 0; $("div#index > article > ul > li.thm").each(function(){ LOADMORE_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 ){ var target = LOADMORE_thmArr[i]; target.find(".img > *").imagesLoaded(function(){ y = Math.round(target.offset().top); if( LOADMORE_thmArr[i-1] ){ var prev_target = LOADMORE_thmArr[i-1]; prev_y = Math.round(prev_target.offset().top); } if( y - prev_y > 100 ){ if( vertical_align != "bottom" ){ vertical_align = "bottom"; }else if( vertical_align != "top" ){ vertical_align = "top"; } } target.addClass("vertical_align_" + vertical_align); var target_width = target.find(".img").width(); var target_height = target_width/1.6; var target_ratio = target_height/target_width; var img_height = target.find(".img > *").height(); var img_width = target.find(".img > *").width(); var img_ratio = img_height/img_width; if( target_ratio > img_ratio ){ var add_class = "vertically"; }else{ var add_class = "horizontally"; } target.addClass(add_class); // if( target.is(".on") ){ // target.stop().animate({opacity:"1"},400); // var ua = navigator.userAgent; // var isIE8 = ua.match(/msie [8.]/i); // if( isIE8 ){ // target.find("figure *[class != 'text_wrapper']").animate({"opacity":1},200); // } // }else{ // target.stop().animate({opacity:"0.1"},400); // var ua = navigator.userAgent; // var isIE8 = ua.match(/msie [8.]/i); // if( isIE8 ){ // target.find("figure *[class != 'text_wrapper']").animate({"opacity":0.1},200); // } // } setTimeout(function(){ target.css({"opacity": 1}); },1000); setTimeout(function(){ i++; LOADMORE_index_thumbs_fade(i); },10); }); }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: "https://www.studiokuplus.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); },10); }); $(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( "https://www.studiokuplus.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( "https://www.studiokuplus.com/", "" ); LOADMORE_loadmore_flag = false; LOADMORE_loadmore_index( id, index_count_i, index_count_limit, href ); } } }); });