// image viewer (photoviewer.js) function imgModal($ele){ if($ele && $ele != undefined){ var items = []; var thisIndex = 0; // start image index 초기화 var options = { modalWidth: 500, // default: 320 modalHeight: 500, // default: 320 headerToolbar: ['maximize','close'], //footerToolbar: ['zoomIn','zoomOut','prev','fullscreen','next','actualSize','rotateLeft','rotateRight'], footerToolbar: ['zoomIn','zoomOut','fullscreen','actualSize','rotateLeft','rotateRight'], i18n: { minimize: '최소화', maximize: '최대화', close: '닫기', zoomIn: '확대', zoomOut: '축소', prev: '이전', next: '다음', fullscreen: '전체 화면', actualSize: '원본 크기', rotateLeft: '왼쪽으로 회전', rotateRight: '오른쪽으로 회전' }, //keyboard: false, resizable: false, // resize zIndex: 99999, // z-index draggable:true, movable: true, //fixedModalSize: true, // open modal size pixed (default: false) //fixedModalPos: true, // If true, Modal size(width, height) fixed when image changes (default: false) multiInstances: false, // If false, only open single photoviewer (default: true) //progressiveLoading: false, // loading (default: true) //movable: true, title: true, callbacks: { beforeOpen: function(context){ }, opened: function(context){ }, beforeClose: function(context){ }, closed: function(context){ }, beforeChange: function(context, index){ }, changed: function(context, index){ } } }; if($ele.closest('ul.uploadImgUl').find('a.uploadImg').length > 1){ $ele.closest('ul.uploadImgUl').find('a.uploadImg').each(function(idx){ if($(this).attr('data-src') != ''){ items.push({ src: $(this).attr('data-src'), title: $(this).attr('data-title') }); if($(this).attr('data-src') == $ele.attr('data-src')) thisIndex = idx; } }); if(items.length > 0){ options['footerToolbar'].splice(2,0,'prev'); options['footerToolbar'].splice(4,0,'next'); options['index'] = (thisIndex >= 0) ? thisIndex : 0; // start image index } } else{ items.push({ src: $ele.attr('data-src'), title: $ele.attr('data-title') }); } new PhotoViewer(items, options); } }