$(function() { 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("
"); SLIDE_fullscreen_resizeContainer(); var target = $("div#" + SLIDE_fullscreen_set_img_div); target.find("img").load(function () { past_target.animate({"opacity": 0}, 2000, "swing", function() { $(this).remove(); } ); SLIDE_fullscreen_imgHEIGHT = eval(SLIDE_fullscreen_media_array[ SLIDE_fullscreen_create_img_i ][4]); SLIDE_fullscreen_imgWIDTH = eval(SLIDE_fullscreen_media_array[ SLIDE_fullscreen_create_img_i ][5]); SLIDE_fullscreen_resizeContainer(); target.animate({"opacity": 1}, 2000, "swing"); SLIDE_fullscreen_preload_image(); SLIDE_fullscreen_scrCtr(); }); target.find("img").attr("src", imgURL); } } function SLIDE_fullscreen_preload_image(){ if( SLIDE_fullscreen_preload_i ){ $("#SLIDE_fullscreen img#pre_" + SLIDE_fullscreen_preload_i).remove(); } SLIDE_fullscreen_preload_i = eval(SLIDE_fullscreen_create_img_i)+1; if( SLIDE_fullscreen_preload_i < SLIDE_fullscreen_media_max_num ){ var next_imgURL = SLIDE_fullscreen_media_array[ SLIDE_fullscreen_preload_i ][0]; $("#SLIDE_fullscreen #main").append(""); var next_target = $("#SLIDE_fullscreen img#pre_" + SLIDE_fullscreen_preload_i ); next_target.attr("src", next_imgURL); } } function SLIDE_fullscreen_resizeContainer(e) { var window_height = $(window).height(); var window_width = $(window).width(); var navi_height = $("#navi").height(); var frame_height = window_height - navi_height; SLIDE_fullscreen_marginHEIGHT = navi_height+30; SLIDE_fullscreen_marginWIDTH = 40; SLIDE_fullscreen_marginTOP = 30; if( window_width <= 740 ){ SLIDE_fullscreen_marginHEIGHT = navi_height; SLIDE_fullscreen_marginWIDTH = 0; SLIDE_fullscreen_marginTOP = 0; }else if( window_width <= 500 ){ SLIDE_fullscreen_marginHEIGHT = navi_height+30; SLIDE_fullscreen_marginWIDTH = 0; SLIDE_fullscreen_marginTOP = 30; } var img_height = window_height - (SLIDE_fullscreen_marginHEIGHT+SLIDE_fullscreen_marginTOP); var img_width = window_width - SLIDE_fullscreen_marginWIDTH*2; $("div#SLIDE_fullscreen #frame").css("height", frame_height); $("div#SLIDE_fullscreen #frame").css("width", window_width); $("#SLIDE_fullscreen .controller").css("top", (frame_height - $("#SLIDE_fullscreen .controller").height())/2 + SLIDE_fullscreen_marginTOP); if( SLIDE_fullscreen_imgWIDTH != 0 ){ if( Math.round(SLIDE_fullscreen_imgWIDTH / img_width * 100) <= Math.round(SLIDE_fullscreen_imgHEIGHT / img_height * 100) ){ var set_height = img_height; var set_width = SLIDE_fullscreen_imgWIDTH*Math.round(set_height/SLIDE_fullscreen_imgHEIGHT*100)/100; var set_margin_top = (window_height - set_height - navi_height)/2; var set_margin_left = (window_width - set_width)/2; }else{ var set_width = img_width; var set_height = SLIDE_fullscreen_imgHEIGHT*Math.round(set_width/SLIDE_fullscreen_imgWIDTH*100)/100; var set_margin_top = (window_height - set_height - navi_height)/2; var set_margin_left = (window_width - set_width)/2; } $("div#SLIDE_fullscreen div#" + SLIDE_fullscreen_set_img_div + " img" ).css("height", set_height); $("div#SLIDE_fullscreen div#" + SLIDE_fullscreen_set_img_div + " img" ).css("width", set_width); $("div#SLIDE_fullscreen div#" + SLIDE_fullscreen_set_img_div + " img" ).css("margin-top", set_margin_top + SLIDE_fullscreen_marginTOP); $("div#SLIDE_fullscreen div#" + SLIDE_fullscreen_set_img_div + " img" ).css("margin-left", set_margin_left); } } $("#SLIDE_fullscreen div.arrow_box_photo_right").click(function(){ SLIDE_fullscreen_create_img_i ++; if( SLIDE_fullscreen_create_img_i == SLIDE_fullscreen_media_max_num){ SLIDE_fullscreen_create_img_i = 0; } SLIDE_fullscreen_create_img(); }) $("#SLIDE_fullscreen div.arrow_box_photo_left").click(function(){ if( SLIDE_fullscreen_create_img_i == 0){ SLIDE_fullscreen_create_img_i = SLIDE_fullscreen_media_max_num; } SLIDE_fullscreen_create_img_i --; SLIDE_fullscreen_create_img(); }) $("#SLIDE_fullscreen .arrow_box_photo_right, #SLIDE_fullscreen .arrow_box_photo_left").mouseover(function(){ $(this).stop().animate({ opacity : 1 },200) } ) $("#SLIDE_fullscreen .arrow_box_photo_right, #SLIDE_fullscreen .arrow_box_photo_left").mouseout(function(){ $(this).stop().animate({ opacity : 0.6 },400) } ) $("#SLIDE_fullscreen .arrow_box_photo_right, #SLIDE_fullscreen .arrow_box_photo_left").animate({ opacity : 0.6 },100) function SLIDE_fullscreen_scrCtr(){ if( SLIDE_fullscreen_start_flag == "false" ){ SLIDE_fullscreen_start_flag = "true"; }else{ clearTimeout( SLIDE_fullscreen_Repeater ); } if( SLIDE_fullscreen_repeat_flag == "true" ){ $("#SLIDE_fullscreen div.play_box").css("display", "none"); $("#SLIDE_fullscreen div.stop_box").css("display", "block"); SLIDE_fullscreen_Repeater = setTimeout( function(){ SLIDE_fullscreen_slidePlay(); } , 5000); }else{ $("#SLIDE_fullscreen div.play_box").css("display", "block"); $("#SLIDE_fullscreen div.stop_box").css("display", "none"); } } function SLIDE_fullscreen_slidePlay(){ SLIDE_fullscreen_create_img_i ++; if( SLIDE_fullscreen_create_img_i == SLIDE_fullscreen_media_max_num){ SLIDE_fullscreen_create_img_i = 0; SLIDE_fullscreen_repeat_limit ++; if( SLIDE_fullscreen_repeat_limit > SLIDE_fullscreen_repeat_limit_max ){ SLIDE_fullscreen_repeat_limit = 0; SLIDE_fullscreen_repeat_flag = "false"; } } SLIDE_fullscreen_create_img(); } SLIDE_fullscreen_media_array = [['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014512_0297.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014512_0297.jpg', '', '', 340, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0902_173201_0347.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0902_173201_0347.jpg', '', '', 1000, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0831_220315_4135.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0831_220315_4135.jpg', '', '', 1460, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0831_220649_8201.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0831_220649_8201.jpg', '', '', 1267, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0909_095424_3871.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0909_095424_3871.jpg', '', '', 1284, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014540_8805.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014540_8805.jpg', '', '', 1311, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014544_1092.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014544_1092.jpg', '', '', 1016, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014547_9755.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014547_9755.jpg', '', '', 1099, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014552_4982.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014552_4982.jpg', '', '', 967, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014555_1640.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014555_1640.jpg', '', '', 903, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014605_3019.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014605_3019.jpg', '', '', 1129, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014559_3572.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014559_3572.jpg', '', '', 984, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0905_014608_6409.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0905_014608_6409.jpg', '', '', 961, 1000, '' ],['https://s3.media-nisor.site/image/giichi_entry_2013_0906_014242_6060.jpg', 'https://s3.media-nisor.site/image_thumbs/giichi_entry_2013_0906_014242_6060.jpg', '', '', 1397, 1000, '' ]]; SLIDE_fullscreen_media_max_num = 14; var wrapper = $("
").attr("id","SLIDE_fullscreen_thumbs_wrapper"); var a; for(var i=0;i < SLIDE_fullscreen_media_max_num; i++){ a = $("").attr("id","SLIDE_fullscreen_" + i).text(i+1).addClass("over"); wrapper.append(a); } $("#container").prepend(wrapper); SLIDE_fullscreen_initialize(); });