/* * requires:jQuery v1.10.1 later * name:settings.js * author:Manabu Kushimoto(web-park.org) */ var GN={ ww:function(){ var v=$(window).innerWidth(); return v; }, wh:function(){ var v=$(window).innerHeight(); return v; }, dh:function(){ var v=Math.max.apply(null,[document.body.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.documentElement.clientHeight]); return v; }, st:function(){ var v=$(window).scrollTop(); return v; }, gt:function(){ var v=$("#gnav").offset().top; return v; } } jQuery(function($){ $.fn.extend({ // �y�[�WTOP�ʒu pageTopPosition:function(options){ var defaults={ space:GN.wh()-50 }; var op=$.extend(defaults,options); var $t=$(this); $t.css({top:op.space+"px"}); }, // �^�[�Q�b�g�����N // targetLink:function(options){ // var defaults={ // target:"" // }; // var op=$.extend(defaults,options); // var $t=$(this); // var href=$t.find(op.target).attr("href"); // $t.on("click",function(){ // window.open(href,"_self"); // }); // $t.find("a").on("click",function(){ // $t.off("click"); // $t.targetLink(); // }); // }, // �y�[�W���X�N���[�� pageScroll:function(options){ var defaults={ speed:800 }; var op=$.extend(defaults,options); var $t=$(this); $t.on("click",function(){ var Hash=$(this.hash); try{ var HashOffset=$(Hash).offset().top; }catch(e){ return false; } $("html:not(:animated),body:not(:animated)").animate({ scrollTop:HashOffset-40 },op.speed); return false; }); } }); //$("#news ul").find("li").each(function(){ $(this).targetLink({ target:".target" }); }); //$("#site_list").find("article").each(function(){ $(this).targetLink({ target:".target" }); }); $("a[href^=#]").pageScroll({speed:600}); $(window).on({ "load":function(){ $("#pagetop").find("a").pageTopPosition(); }, "resize":function(){ $("#pagetop").find("a").pageTopPosition(); } }) }); // JavaScript Document // fadeOver $(document).ready(function(){ $(".fadeOver").hover(function(){$(this).fadeTo("fast", 0.7);},function(){$(this).fadeTo("fast", 1);}); $(".tBlank").attr("target","_blank"); // imgover $('.imgover').each(function(){ this.osrc = $(this); this.rollover = new Image(); this.rollover.src = this.osrc.replace(/(\.gif|\.jpg|\.png)/, "_o$1"); }).hover(function(){ $(this).attr('src',this.rollover.src); },function(){ $(this).attr('src',this.osrc); }); });