// hide for addressbar $(function(){ setTimeout(function(){ if(document.body.scrollTop == 0){ if( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) ) { setTimeout(scrollTo, 100, 0, 1); } else if (navigator.userAgent.match(/Android/i)) { window.scrollTo(0,1); } } },1000); }); // hide for counter $(function(){ jQuery('iframe').contents().find('.pluginCountButton').css('display', 'none').end().end() }); // smooth scroll (Android exclusion) $(function(){ $("a.smooth").click(function(){ if (navigator.userAgent.match(/Android/i)) { window.scrollTo(0,$($(this).attr("href")).offset().top); } else { $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'slow','swing'); } return false; }); }); // item show effect $(function(){ // only open $(".openBox a").click(function(){ var target = $(this).attr("href"); openBox(target, true); return false; }) // only close $(".closeBox a, .closeBoxBehind a").click(function(){ // style reset var target = $(this).attr("href"); $(target).removeClass("fadeIn"); $(".modal_inner").css({top: 0, left:0}); $("a").removeClass("noHighlight"); $(target).hide(); return false; }) // close and open $(".pager a").click(function(){ $(".modal").hide().removeClass("fadeIn"); // close var target = $(this).attr("href"); openBox(target, false); // open return false; }) function openBox(target, isOpenBox) { var h = $(document).height(); if(navigator.userAgent.indexOf('Android') < 0 && isOpenBox){ $(target).css({ height: h }).show().addClass("fadeIn"); } else { $(target).css({ height: h }).show(); } var inner = $(target).find(".modal_inner_box"); var inner_h = inner.height(); var window_h = $(window).height(); var scroll_t = $(window).scrollTop(); var t = ( window_h - inner_h )/2 + scroll_t; if ( t < 10 ) { t = 10 } if ( window_h < inner_h + 20 ) { t = scroll_t + 20; } var chkHeight = h - (t + inner_h ); if ( chkHeight < 0 ) { $(target).css({ height: h - chkHeight + 40 }); } if ( isOpenBox ) { $(".modal_inner").css({top: t}); $("a").addClass("noHighlight"); $(".modal a").removeClass("noHighlight"); } } });