//jQuery-1.11.1 //var $jQ1_11 = $.noConflict(true); $(function(){ //jquery.colorbox SettingScript var confirmElm = { 'trigger' : $('.modal_on'), 'target' : $('#chkboxAlert') }; var resizeSecond = 500, resizeTimer; var htmlBody = $('body'); var colorBoxOption = function () { var baseOpt = { inline : true, opacity : 0.6, initialWidth : 600, href : confirmElm['target'] }; //スマホ用の指定 var width = $(window).width(); //スマホ用の指定 var agent = navigator.userAgent; if(navigator.userAgent.match(/(iPhone|iPod|Android)/)!==null){ // if ( width < 420 ) { htmlBody.addClass('smpDisplay'); baseOpt["initialWidth"] = '90%'; baseOpt["width"] = '90%'; baseOpt["maxWidth"] = '100%'; // baseOpt["maxHeight"] = '100%'; } return baseOpt; }; var $chkboxTbls = $('table.chkboxTbl'); confirmElm['trigger'].on('click', function (event) { $("#cboxClose").css('display','none'); var modal = $(this).next().html(); $("#chkboxAlert div.modalBlock div.blockInner").html(modal); var opt = colorBoxOption(); confirmElm['trigger'].colorbox(opt); $(window).resize(function(){ if ( !resizeTimer ) { resizeTimer = true; setTimeout(function (){ $.colorbox.resize({scalePhotos:true}); if(navigator.userAgent.match(/(iPhone|iPod|Android)/)!==null){ // if ( width < 420 ) { $.colorbox.resize({width:'90%'}); } resizeTimer = false; },resizeSecond); } }); $("#colorbox").css('overflow','visible'); $("#cboxLoadedContent").css('overflow','visible'); $("#cboxClose").css('display',''); event.preventDefault(); }); });