/*
* requires:jQuery v1.8.2 later
* name:settings.js
* author:Manabu Kushimoto(web-park.org)
*/
jQuery(function($){
$.fn.extend({
// ページ内スクロール
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
},op.speed);
return false;
});
},
// ホバースライド
// hoverSlide:function(options){
// var defaults={
// w:130,
// speed:300,
// interval:0,
// limit:4
// };
// var op=$.extend(defaults,options);
// var $t=$(this); //#top_pick_up_item .slide_block
// var $move=$t.find(".move");
// var $li=$move.find("li");
// var direct={
// prev:$(''),
// next:$('')
// }
// var len=$li.length;
// var new_len=0;
// var index=0;
// var num={
// last:0,
// first:0
// }
// var next_index=0;
// var autoEvent="";
// var interval={
// auto:"",
// prev:"",
// next:""
// }
// var bool=true;
// var getLeft=function(target){ var v=new Number(target.css("left").replace(/^([\D])?([\d]+)px/,"$1$2")); return v; }
// var slideEvent=function(){
// for(var i=0;inum.last){
// $li.eq(i).css({left:(num.first+op.w)+"px"});
// }else if(left'),
next:$('')
}
var len=$li.length;
var new_len=0;
var index=0;
var left=len*op.w;
var next_index=0;
var autoEvent="";
var autoInterval=""
var bool=true;
// 矢印表示非表示
var arrowDisplay=function(){
if(index==0){
direct.prev.hide();
direct.next.show();
}else if(index==Math.floor((len-1)/op.limit)){
direct.prev.show();
direct.next.hide();
}else{
direct.prev.show();
direct.next.show();
}
}
// スライドイベント
var slideEvent=function(){
$move.stop(true,false).animate({
left:-op.w*index+"px"
},op.speed,function(){
bool=true;
if(op.loop){
if(index==0){
$(this).css({left:-(len-(op.limit*2))*op.w+"px"});
index=len-(op.limit*2);
}
if(index==(len-op.limit)){
$(this).css({left:-op.limit*op.w+"px"});
index=op.limit;
}
}else{
arrowDisplay();
}
});
};
// 自動切り替え
autoEvent=function(){
if(op.interval){
autoInterval=setTimeout(function(){
index=(index==len-op.limit)?0:index+1;
slideEvent();
autoEvent();
},op.interval);
}
};
// 初期設定
if(op.limit<=len){
if(op.loop){
for(var i=0;i