/********************************************* * guiltygearcontentsName.js *********************************************/ /* ------------------------------------------- * @init ------------------------------------------- */ $(function(){ var u = new EPOS_CARD.Util(); $.scrollButtonFixed(); $.modal(); $.narrowDown(); $(window).on('load', function (){ }); }); /* ------------------------------------------- * @plugin ------------------------------------------- */ (function($){ /* * $.scrollButtonFixed * ボタンフロート制御 */ $.scrollButtonFixed = function(){ var u = new EPOS_CARD.Util(); var $elm = $('.js-floatButtonWrap'), $button = $('.js-floatButton'), fixedClass = 'is-fixed'; if($elm.length === 0){ return false; } // trigger var buttonHeight = $button.innerHeight(); $elm.css('padding-bottom', buttonHeight); fixed(); $(window).on('scroll', function (){ fixed(); }); //setting function fixed() { var elm_top = $elm.offset().top, elmHeight = $elm.innerHeight(), scroll_top = $(window).scrollTop(); if(scroll_top > elm_top + elmHeight) { $elm.addClass(fixedClass); } else { $elm.removeClass(fixedClass); } } }; /* * @method modal */ $.modal = function(config){ var u = new EPOS_CARD.Util(); var c = $.extend({ elm: ".js-modal" },config); // vars var $elm = $(c.elm); if($elm.length === 0){ return false; } // trigger if(!u.isRangeSP()){ $elm.colorbox({ inline: true, width: "100%", maxWidth: "1242px", maxHeight: "92%", fixed: true, onComplete: function(){ EPOS_CARD.module.equalHeight(true, true); EPOS_CARD.module.sizeFix(); } }); } else { $elm.colorbox({ inline: true, height: "", maxWidth: "100%", maxHeight: "100%", fixed: true, onComplete: function(){ EPOS_CARD.module.equalHeight(true, true); EPOS_CARD.module.sizeFix(); } }); } }; /* * $.narrowDown * 絞り込み制御 */ $.narrowDown = function(config){ var u = new EPOS_CARD.Util(); var c = $.extend({ elm: ".js-narrowDownButton", storeArea: ".js-storeArea", manyInquiriesStore: ".js-manyInquiriesStore" },config); var $elm = $(c.elm), $storeArea = $(c.storeArea), $manyInquiriesStore = $(c.manyInquiriesStore); if($elm.length === 0){ return false; } // trigger $elm.on('click', function() { narrowDownControl($(this)); }) //setting function narrowDownControl(element) { var self = element, initials = self.data('line'); $storeArea.hide(); $manyInquiriesStore.hide(); $(c.storeArea + '[data-line="' + initials + '"]').show(); } }; })(jQuery);