// jquery.tile.js
(function($) {
$.fn.tile = function(columns) {
var tiles, max, c, h, last = this.length - 1, s;
if(!columns) columns = this.length;
this.each(function() {
s = this.style;
if(s.removeProperty) s.removeProperty("height");
if(s.removeAttribute) s.removeAttribute("height");
});
return this.each(function(i) {
c = i % columns;
if(c == 0) tiles = [];
tiles[c] = $(this);
h = tiles[c].height()+ 35 ;
if(c == 0 || h > max) max = h ; //商品li BOXの高さ、コンテツに応じる
if(i == last || c == columns - 1)
$.each(tiles, function() { this.height(max); });
});
};
})(jQuery);
/*
utility.index ファイルは読ませない
*/
// viewport
var viewport = document.createElement('meta');
viewport.setAttribute('name', 'viewport');
viewport.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0');
document.getElementsByTagName('head')[0].appendChild(viewport);
$(function () {
// global navi
function globalNavi() {
$('.header_nav_global_left li').hover(
function () {
$('.header_nav_global_box',$(this)).show();
},
function () {
$('.header_nav_global_box',$(this)).hide();
}
)
}
// side menu
function categoryList_pc() {
// sp cancel
$('.side_category_list').each(function () {
$('> a',$(this)).off('click');
});
$('.list_icon_arrow').removeClass('icon-chevron_down');
$('.side_category_list').hover(
function () {
$('.side_subcategory_lists', $(this)).show();
},
function () {
$('.side_subcategory_lists', $(this)).hide();
}
)
}
function categoryList_sp() {
// pc cancel
$('.side_category_list').off('mouseenter').off('mouseleave');
$('.side_category_list').each(function () {
var n = $('.side_subcategory_lists', $(this)).size();
if(n > 0) {
$('> .list_icon_arrow',$(this).children()).addClass('icon-chevron_down');
}
$('> a',$(this)).on('click', function (e) {
if(n > 0) {
e.preventDefault();
$('.icon-chevron_down',$(this)).toggleClass('icon-chevron_up');
$(this).next().stop().slideToggle('fast');
}
});
});
}
var device = null;
// ranking
$('.rank_pc_box').each(function(i){
$(this).addClass('rank_box_color_' + (i+1));
});
$('.rank_pc_number').each(function(i){
$(this).text(i+1);
});
$('.rank_sp_box').each(function(i){
$(this).addClass('rank_box_color_' + (i+1));
});
$('.rank_sp_number').each(function(i){
$(this).text(i+1);
});
// sp_navi
$('.nav_btn_phone').click(function(){
if ($('.header_nav_lst_phone').css('display') == 'none') {
$('.header_nav_lst_phone').slideDown('fast');
} else {
$('.header_nav_lst_phone').slideUp('fast');
}
});
// gmo_cmspbar
function window_size_cmspbar_func() {
$(window).scroll(function () {
var scrlt = $(window).scrollTop();
if(scrlt > 99 ) {
$('.header_mid').addClass('header_mid_cmspbar');
$('#page_top').css('opacity','1');
} else {
$('.header_mid').removeClass('header_mid_cmspbar');
$('#page_top').css('opacity','0');
}
});
}
// footer_list_minheight
function window_size_minheight_func() {
$('.footer_list').each(function () {
var ProductImageSize = $(this).width();
$('img', $(this)).css('maxHeight', ProductImageSize + 'px');
});
}
globalNavi();
window_size_minheight_func();
$(window).resize(function () {
window_size_minheight_func();
});
$(window).on('load resize', function(){
var windowWidth = $(window).width();
var isPhoneSize = 768;
if (windowWidth <= isPhoneSize) {
if (device !== "sp") {
device = "sp";
categoryList_sp();
}
} else {
if (device !== "pc") {
device = "pc";
categoryList_pc();
}
}
window_size_cmspbar_func();
window_size_tile_func();
});
$(window).load(function () {
$('.more-prd').click(function () {
$(this).hide();
$(this).removeClass('hidden-desktop');
$(this).prev().children().removeClass('hidden-desktop');
$(this).addClass('hidden-phone');
$(this).prev().children().fadeIn();
$(this).prev().children().removeClass('hidden-phone');
window_size_minheight_func();
window_size_tile_func();
});
});
});
// tile
var loadtop = 0;
function window_size_tile_func() {
var ftpage = backimg_position() + loadtop;
$('body').css({ 'background-position-y': ftpage + 'px' });
loadtop = 0;
if($(window).width() >= 768) {
$('.seller_list').tile(4);
$('.recommend_list').tile(3);
$('.footer_seller_list').tile(10);
$('.footer_recommend_list').tile(10);
$('.footer_checked_list').tile(10);
} else {
$('.seller_list').tile(3);
$('.recommend_list').tile(3);
$('.footer_seller_list').tile(3);
$('.footer_recommend_list').tile(3);
$('.footer_checked_list').tile(3);
}
}
//背景画像のボトム位置
function backimg_position(){
var ftpage = $('.footer_pagetop').offset().top - 2100;
return ftpage;
// $('body').css({ 'background-position-y': ftpage + 'px' });
}
window.onload = function () {
if( $('body').hasClass('toppage'))
loadtop = 274;
else
loadtop = 64;
}
//除外カテゴリをhidden
$('li.category_parent').each(function(i,e){
var category_neme = $(this).text().trim();
if ( rmCategoryList.indexOf(category_neme) != -1) {
$(this).addClass('hidden');
}
})
/* sold out の画像を変更
$('.new_mark_img1').each(function(i,e){
$(this).attr('src','画像パス');
});
*/
カテゴリーから探す
- Ladies Hairbrushes
- Men's Hairbrushes
- Handmade Hairbrushes
- 'Perfect for your hair' Hairbrushes
- Clothes Care Brushes
- Combs
- Baby Brushes
- Shaving Brushes
- Beard Brush
- Shoe Brushes
- Toothbrushes
- Pebble Brush
- Cleaning Brush
- Outlet - Ladies Hairbrushes
- Outlet - Men's Hairbrushes
- Outlet - Clothes Care Brushes
- Outlet - Classic Shine Hairbrushes
- Outlet - Shoe Brushes