');
}
var imgfolder_url = "https://tool.hokubatsu.com/img/";
//-----------------------------------------------
// chg 4 itemlist (item)
//-----------------------------------------------
var isTouch = ('ontouchstart' in window);
if(isTouch) {
//smapho
clickSmapho();
} else {
//pc
//create
clickPC();
}
// create dummybox
var $dummyHTML = '
';
var $bgURL = imgfolder_url + 'bg_top.jpg';
$("#container").prepend($dummyHTML);
$("#xx").css({
"background-image": $bgURL,
"background-position":"top center",
"background-attachment":"scroll",
"height" : $("#container").height(),
"width" : $("#container").width(),
"z-index" : -50,
"display" : "block"
});
// link
$("#bgis > dl , #bgis > p").hover(function(e){
$("#bgis").css({ opacity: "0.85" });
},function(e){
$("#bgis").css({ opacity: "1" });
});
// background:windowResize:15/05/25
$(window).resize(function(){
$('.bglayer').css({
"width" : $("#container").width() ,
"height" : $("#container").height()
});
});
}
function horizon() {
var frameIDs = $('.products-list').children('div');
var isTouch = ('ontouchstart' in window);
for (var i = 0; i < frameIDs.length; i++) {
if(isTouch) {
} else {
var frameID = frameIDs[i].id;
var $frame = $('#' + frameID );
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame;
// PC
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: false,
activateOn: 'click',
mouseDragging: 0,
touchDragging: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
scrollTrap: true,
pagesBar: null,
activatePageOn: 'click',
speed: 500,
elasticBounds: 0,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 0,
clickBar: 1,
rollTrap: false,
// Buttons
forward: null,
backward: null,
prev: null,
next: null,
prevPage: null,
nextPage: null
});
}
}// END-for
} // END horizon()
// ----------
// Voice
// ----------
if($("#voice").size() > 0) {
var $container = $('#voice');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.voice-item',
isFitWidth: true,
isAnimated: false
});
});
}
// ----------
// DETAIL
// ----------
if($('.detail').length) {
// ----------------------
// img color grouping
// ----------------------
$d = $(".product-thumb-image");
// colored img named. started
// ex.) id****_01_mos.jpg
if($d.length > 6 && $d.first().attr('src').match(/_01_/i)) {
var $colorList = [];
var $buttonList = {};
var $url;
$d.each(function(index){
// url
$url = $(this).attr('src');
$urlSplit = $url.split('_');
$color = $urlSplit[2];
if($urlSplit.length==4) {
// for colorli
if(jQuery.inArray($color, $colorList) == -1) {
$colorList.push($color);
}
}
// for colorchg btn
if(!$buttonList[$color]) $buttonList[$color] = [];
$buttonList[ $color ].push($url);
});
// deleteThumbList
$(".product-image-list").remove();
// createBtnBox
$(".product-image-lists").after('
');
// createBtn
var $colorBtn = "";
var $cnt = 0;
for(var $k in $buttonList) {
// define ID
$btnId = "cBtn-"+ $k;
$targetId = "ul-"+ $k;
// create ul of url each colors
// THUMB NAIL
$imgList = $buttonList[$k];
$buf = "";
for(var $kk=0; $kk<$imgList.length; $kk++) {
if($kk==0) $buf += '
';
$buf += '- ';
$buf += '
';
if($kk == $imgList.length-1) {
$buf += '
';
$(".product-image-lists").append($buf);
}
}
// create-colorBtn
$colorBtn = '
';
$colorBtn += '';
$colorBtn += '';
$("#colorBtn ul").append($colorBtn);
$firstBtn = "";
if($cnt==0) {
$("#"+ $targetId).css("display","block");
$firtstBtn = $btnId;
}
$cnt++;
}
// append btnClick
function colorBtnClick(x) {
// btn effect
thumbBorderOff($("#colorBtn a"));
thumbBorderOn(x);
// target effect
$thumbUlId = x.attr("rel");
if($("#"+ $thumbUlId).css("display")!="block") {
$(".product-image-list").css({"display":"none"});
$("#"+ $thumbUlId).css("display","block");
}
// target border
thumbBorderOn($("#"+ $thumbUlId + " li:first-child a"));
thumbClick($("#"+ $thumbUlId + " li:first-child a"));
thumbOpacityOff($(".product-image-list a"));
thumbOpacityOn($("#"+ $thumbUlId + " li:first-child a"));
return false;
}
$(".colorBtn").click(function(){
colorBtnClick($(this));
return false;
});
// btn settings first
thumbBorderOff($("#colorBtn a"));
thumbBorderOn($("#"+ $firtstBtn));
}
// thumbnail settings first
thumbOpacityOff($(".product-image-list a"));
thumbBorderOff($(".product-image-list a"));
thumbOpacityOn($(".product-image-list a:first"));
thumbBorderOn($(".product-image-list a:first"));
$(".product-image-list a").click(function(e){
thumbBorderOff($(this));
thumbOpacityOff($(".product-image-list a"));
thumbClick($(this));
thumbOpacityOn($(this));
return false;
});
function thumbOpacityOn(x) {
x.css({"opacity":"1"});
}
function thumbOpacityOff(x) {
x.css({"opacity":"0.5"});
}
function thumbBorderOn(x) {
x.css({"border":"solid 1px #AAAAAA"});
}
function thumbBorderOff(x) {
x.css({"border":"solid 1px #FFFFFF"});
}
function thumbClick(x) {
var link = x.attr("href");
$(".product-image").attr("src",link);
thumbBorderOff($(".product-image-list a"));
thumbBorderOn(x);
}
}
});