웹 프론트엔드 JS 튜토리얼 Highslide JS_javascript 팁

Highslide JS_javascript 팁

May 16, 2016 pm 07:13 PM
highslide js

/**************************************************** **************************
이름:    Highslide JS
버전: 3.1.0(2007년 3월 1일)
저자 :  Torstein H鴑si
지원: http://vikjavev.no/highslide/forum
이메일:   http://vikjavev.no/megsjol 참조

라이센스:
Highslide JS는 Creative Commons Attribution-NonCommercial 2.5
라이선스(http://creativecommons.org/licenses/by-nc/2.5/)에 따라 라이선스가 부여됩니다.

당신은 무료입니다:
    * 저작물을 복사, 배포, 전시, 공연
    * 파생 저작물 제작

다음 조건에 따라:
    * 저작자 표시. 
저작자 또는 라이센스 제공자가 지정한 방식으로 저작물의 저작자를 표시해야 합니다.
    * 비영리적. 이 저작물을 상업적인 목적으로 사용할 수 없습니다.

* 모든 재사용  또는 배포의 경우, 귀하는 이 저작물의 라이선스
약관을 다른 사람에게 분명히 밝혀야 합니다.

 저작권 보유자로부터 허가를 받은 경우 이러한 조건 중 하나라도 포기될 수 있습니다.

귀하의 공정한 사용 및 기타 권리는 위 사항의 영향을 받지 않습니다.
************************************************************************ *******************************/

var hs = {

// 여기에서 자신만의 설정을 적용하거나 html 파일에서 재정의합니다.  
graphicsDir : 'highslide/graphics/',
restoreCursor : "zoomout.cur", // 사전 로드에 필요
fullExpandIcon : 'fullexpand.gif',
expandSteps : 10, // 개 단계적으로 확대됩니다. 각 단계는 기간/단계 밀리초 동안 지속됩니다.
expandDuration : 250, // 밀리초
restoreSteps : 10,
restoreDuration : 250,
allowMultipleInstances: true,
hideThumbOnExpand :
captionSlideSpeed : 1, // 설정 0 슬라이드 인 효과를 비활성화하려면
outlineWhileAnimating : 0, // 권장하지 않으며 느린 시스템에서는 애니메이션이 들쭉날쭉해집니다.
outlineStartOffset : 3, // 10에서 끝남
marginLeft : 10,
marginRight : 35, // 스크롤바를 위한 공간 남기기   outline
marginTop : 10,
marginBottom : 35, // 나가기 스크롤바를 위한 공간   개요
zIndexCounter : 1001, // 다른 절대 위치의 요소에 맞게 조정
fullExpandTitle : '放大到实际尺寸'
restoreTitle : '单击可关闭图단편, 本窗口可拖动。使用←→键察看上一图或下一图작품.',
focusTitle : '切换到这幅图picture',
loadingText : 'loading...',
loadingTitle : '点击关闭',
loadingOpacity : 0.75,
showCredits : false , // 원하는 경우 이를 false로 설정할 수 있습니다.
creditsText : 'Powered by Highslide JS',
creditsHref : 'http://vikjavev.no/highslide/?user=1 ',
creditsTitle : 'Highslide JS 홈페이지로 이동',

// 이러한 설정은 각 이미지에 대해 인라인으로 재정의할 수도 있습니다.
앵커: 'auto', /// 이미지가 확장되는 위치
align : 'auto', // 클라이언트 내 위치(앵커 재정의)
captionId : null,
captionTemplateId : null,
slideshowGroup : null, // 다음/이전 링크에 대한 그룹을 정의하고 키 입력
spaceForCaption : 30, // 이미지 아래에 캡션이 있는 공간을 남깁니다.
minWidth: 200,
minHeight: 200,
allowSizeReduction: true, // 이미지가 클라이언트 크기에 맞게 축소되도록 허용합니다. false인 경우 minWidth 및 minHeight
outlineType을 재정의합니다.
        
// 설정 종료


// 내부 속성 선언
preloadTheseImages : new Array(),
continuePreloading: true,
expandedImagesCounter : 0,
expanders : new Array(),
overrides : new Array(
    'anchor',
    'align',
    'outlineType',
    'outlineWhileAnimating',
    ' spaceForCaption', 
    'wrapperClassName',
    'minWidth',
    'minHeight',
    'captionId',
    'captionTemplateId',
    'allowSizeReduction',
    ' 슬라이드쇼그룹 ',
    'enableKeyListener'
),
overlays : new Array(),
toggleImagesGroup : null,
pendingOutlines : new Array(),

// 드래그 기능
ie : (document.all && !window.opera),
safari : navigator.userAgent.indexOf("Safari") != -1,
hasFocused : false,

$ : 함수 (id) {
    return document.getElementById(id);
},

푸시 : 함수(arr, val) {
    arr[arr.length] = val;
},

createElement : 함수(태그, 속성, 스타일, 상위) {
    var el = document.createElement(tag);
    if (attribs) hs.setAttribs(el, attribs);
    if (styles) hs.setStyles(el, styles);
    if (부모) parent.appendChild(el);    
    반환 엘;
},

setAttribs : 함수 (el, 속성) {
    for (var x in 속성) {
        el[x] = attribs[x];
    }
},

setStyles : 함수 (el, styles) {
    for (var x in 스타일) {
        시도 { el.style[x] = styles[x ]; }
        catch(e) {}
    }
},

ieVersion : function () {
    arr = navigator.appVersion.split("MSIE");
    return parseFloat(arr[1]);
},

clientInfo : function ()    {
    var iebody = (document.compatMode && document.compatMode != "BackCompat") 
        ? document.documentElement : document.body;

    this.width = hs.ie ? iebody.clientWidth : self.innerWidth;
    this.height = hs.ie ? iebody.clientHeight : self.innerHeight;
    this.scrollLeft = hs.ie ? iebody.scrollLeft : pageXOffset;
    this.scrollTop = hs.ie ? iebody.scrollTop : pageYOffset;
} ,

위치: 함수(el)    { 
    var parent = el;
    var p = 배열();
    p.x = parent.offsetLeft;
    p.y = parent.offsetTop;
    while (parent.offsetParent)    {
        부모 = parent.offsetParent;
        p.x  = parent.offsetLeft;
        p.y  = parent.offsetTop;
    }
    return p;
}, 

expand : function(a, params, contentType) {
    시도해 보세요 {
        new HsExpander(a, params, contentType);
        false를 반환합니다.

    } catch (e) {
        return true;
    }

},

focusTopmost : function() {
    var topZ = 0;
    var topmostKey = -1;
    for (i = 0; i         if (hs.expanders[i]) {
           if (hs.expanders[i].wrapper.style.zIndex && hs.expanders[i].wrapper.style.zIndex > topZ) {
               topZ = hs.expanders[i].wrapper.style.zIndex;

                topmostKey = i;
           }
        }
    }
    if (topmostKey == -1) hs.focusKey = -1;
    else hs.expanders[topmostKey].focus();
}, 


closeId : function(elId) { // for text link
    for (i = 0; i         if (hs.expanders[i] && (hs.expanders[i].thumb.id == elId || hs.expanders[i].a.id == elId)) {
            hs.expanders[i]. doClose();
            반품;
        }
    }
},

close : function(el) {
    var key = hs.getWrapperKey(el);
    if (hs.expanders[key]) hs.expanders[key].doClose();
    false를 반환합니다.
},


toggleImages : function(closeId, expandEl) {
    if (closeId) hs.closeId(closeId);
    if (hs.ie) expandEl.href = expandEl.href.replace('about:(blank)?', ''); // 신비로운 IE 사물
    hs.toggleImagesExpandEl = expandEl;
    false를 반환합니다.
},

getAdjacentAnchor : function(key, op) {
    var aAr = document.getElementsByTagName('A');
    var hsAr = 새 배열;
    var activeI = -1;
    var j = 0;
    for (i = 0; i         if (hs.isHsAnchor(aAr[i]) && ((hs.expanders[key].slideshowGroup == hs.getParam(aAr) [i], '슬라이드쇼그룹')))) {
            hsAr[j] = aAr[i];
            if (hs.expanders[key] && aAr[i] == hs.expanders[key].a) {
               activeI = j;
            }
            j ;
        }
    }
    return hsAr[activeI   op];

},

getParam : 함수 (a, param) {
    시도 {
        var s = a.onclick.toString();
        var oneLine = s.replace(/s/g, ' ');
        var sParams = oneLine.replace(/.*?hs.(htmlE|e)xpands*?(s*?thiss*?,s*?{(.*?)}.*?$/, '$2 ');
        if (hs.safari) { // 멍청한 버그
           for (var i = 0; i                sParams = sParams.re 장소(hs.재정의 [i]  ':', ','  hs.overrides[i]  ':').replace(/^s*?,/, '')
            }
        }    
        if (oneLine = = sParams) return null
        eval('var arr = {'  sParams  '};');
       for(var x in arr) {
           if (x == param) return arr[x] ;
        }
    } catch (e) {
        return null;
    }
},

getSrc : function (a)    var src = hs. getParam(a, 'src')
    if (src) return src; 🎜>
previousOrNext : 함수 (el, op) {
    if (typeof el == 'object') var activeKey = hs.getWrapperKey(el)
    else (typeof el == 'number'; ) var activeKey = el;
    if (hs.expanders[activeKey]) {
        hs.toggleImagesExpandEl = hs.getAdjacentAnchor(activeKey, op);
        hs.expanders[activeKey].doClose();
    }

    false를 반환합니다.
},

previous : function (el) {
    return hs.previousOrNext(el, -1);
},

next : function (el) {
    return hs.previousOrNext(el, 1);    
},

keyHandler : function(e) {
    if (!e) e = window.event;
    if (!e.target) e.target = e.srcElement; // 즉
    if (e.target.form) return; // 양식 요소에 포커스가 있음

    var op = null;
    스위치(e.keyCode) {
        case 34: // Page Down
        case 39: // 오른쪽 화살표
        case 40: / 왼쪽 화살표
          op = 1;
            휴식;
        case 33: // Page Up
        case 37: //왼쪽 화살표
        case 38: //아래 화살표
            op = -1;
            휴식;
        case 27: // Escape
        case 13: // Enter
            if (hs.expanders[hs.focusKey]) hs.expanders[hs.focusKey].doClose();
            false를 반환합니다.
    }
    if (op != null) {
        hs.removeEventListener(document, 'keydown', hs.keyHandler);
        if (hs.expanders[hs.focusKey] && !hs.expanders[hs.focusKey].enableKeyListener) true를 반환합니다.
        return hs.previousOrNext(hs.focusKey, op);
    }
    그렇지 않으면 true를 반환합니다.
},

registerOverlay : 함수 (오버레이) {
    hs.push(hs.overlays, overlay);
},

getWrapperKey : 함수 (el) {
    var key = -1;
    동안(el.parentNode)    {
        el = el.parentNode;
        if (el.id && el.id.match(/^highslide-wrapper-[0-9] $/)) {
            key = el.id.replace(/^highslide-wrapper-([ 0-9] )$/, '$1');
            휴식;
        }
    }
    return 키;
},

cleanUp : function () {
    if (hs.toggleImagesExpandEl) { 
        hs.toggleImagesExpandEl.onclick();
        hs.toggleImagesExpandEl = null;
    } else {
        for (i = 0; i            if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost ();
        }        
    }
},

mouseClickHandler : function(e) 
{
    if (!e) e = window.event;
    if (e.button > 1) true를 반환합니다.
    if (!e.target) e.target = e.srcElement;

    
    var fobj = e.target;

    while (fobj.parentNode
        && !(fobj.className && fobj.className.match(/highslide-(image|move|html)/)))
    {
        fobj = fobj.parentNode;
    }

    if (!fobj.parentNode) return;

    hs.dragKey = hs.getWrapperKey(fobj);
    if (fobj.className.match(/highslide-(image|move)/)) {
        var isDraggable = true;
        var wLeft = parseInt(hs.expanders[hs.dragKey].wrapper.style.left);
        var wTop = parseInt(hs.expanders[hs.dragKey].wrapper.style.top);            
    }

    if (e.type == 'mousedown') {
        if (isDraggable) // 드래그 또는 포커스
        {
           hs.dragObj = h s.expanders[hs .dragKey].content;

            if (fobj.className.match('highslide-image')) hs.dragObj.style.cursor = '이동';

            hs.leftBeforeDrag = wLeft;
            hs.topBeforeDrag = wTop;

            hs.dragX = e.clientX;
            hs.dragY = e.clientY;
            hs.addEventListener(document, 'mousemove', hs.mouseMoveHandler);
            if (e.preventDefault) e.preventDefault(); // FF

            if (hs.dragObj.className.match(/highslide-(image|html)-blur/)) {
              hs.expanders[hs.dragKey].focus();
                hs.hasFocused = true;
            }
            false를 반환합니다.
        }
        else if (fobj.className.match(/highslide-html/)) { // 그냥 초점
           hs.expanders[hs.dragKey].focus();
            hs.expanders[hs.dragKey].redoShowHide();
            hs.hasFocused = false; // 왜??
        }

    } else if (e.type == 'mouseup') {
        hs.removeEventListener(document, 'mousemove', hs.mouseMoveHandler);
        if (isDraggable && hs.expanders[hs.dragKey]) {
           if (fobj.className.match('highslide-image')) {
              fobj.style.cursor = hs.styleRe 상점커서;
            }
            var hasMoved = wLeft != hs.leftBeforeDrag || wTop != hs.topBeforeDrag;
            if (!hasMoved && !hs.hasFocused && !fobj.className.match(/highslide-move/)) {
               hs.expanders[hs.dragKey].doClose();
           } else if (hasMoved || (!hasMoved && hs.hasHtmlExpanders)) {
               hs.expanders[hs.dragKey].redoShowHide();
            }
            hs.hasFocused = false;

        } else if(fobj.className.match('highslide-image-blur')) {
            fobj.style.cursor = hs.styleRestoreCursor;        
        }
    }
},

mouseMoveHandler : function(e)
{
    if (!hs.expanders[hs.dragKey] || !hs.expanders[ hs.dragKey].wrapper) return;
    if (!e) e = window.event;

    var exp = hs.expanders[hs.dragKey];
    var w = exp.wrapper;    
    w.style.left = hs.leftBeforeDrag   e.clientX - hs.dragX  'px';
    w.style.top  = hs.topBeforeDrag   e.clientY - hs.dragY  'px';

    if (exp.objOutline) {
        var o = exp.objOutline;
        o.outer.style.left = (parseInt(w.style.left) - o.offset)  'px';
        o.outer.style.top = (parseInt(w.style.top) - o.offset)  'px';
    }

    false를 반환합니다.
},

addEventListener : 함수 (el, event, func) {
    if (document.addEventListener) el.addEventListener(event, func, false);
    else if (document.attachEvent) el.attachEvent('on'  event, func);
    else el[event] = func;
},

removeEventListener : 함수 (el, event, func) {
    if (document.removeEventListener) el.removeEventListener(event, func, false);
    else if (document.detachEvent) el.detachEvent('on'  event, func);
    else el[event] = null;
},

isHsAnchor : 함수 (a) {
    return (a.className &&(a.className.match("highslide$") || a.className.match("highslide " )));
},



preloadFullImage : 함수 (i) { ​​
    if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != '정의되지 않음 ') {
        var img = document.createElement('img');
        img.onload = function() { hs.preloadFullImage(i   1); };
        img.src = hs.preloadTheseImages[i];
    }
},

preloadImages : 함수 (숫자) {
    if (숫자) this.numberOfImagesToPreload = 숫자;

    var j = 0;

    var aTags = document.getElementsByTagName('A');
    for (i = 0; i         a = aTags[i];
        if (hs.isHsAnchor(a)) {
           if (j                hs.preloadTheseImages[j] = hs.getSrc(a); 
                j ;
            }
        }
    }

    // 아웃라인 미리 로드
    new HsOutline(hs.outlineType, function () { hs.preloadFullImage(0)} );

    // 커서 미리 로드
    var cur = document.createElement('img');
    cur.src = hs.graphicsDir   hs.restoreCursor;
},

genContainer : function () {
    if (!hs.container) {
        hs.container = hs.createElement('div', 
           null,              { 위치: 'absolute', 왼쪽: 0, 상단: 0, 너비: '100%', zIndex: hs.zIndexCounter }, 
            document.body
        );
    }    
}
}; // hs 개체 종료

//-------------------------------------- --------------
HsOutline = 함수(outlineType, onLoad ) {
    if (!outlineType) return;
    if (onLoad) this.onLoad = onLoad;
    this.outlineType = outlineType;
    this.outline = new Array();
    var v = hs.ieVersion();

    hs.genContainer();

    this.hasAlphaImageLoader = hs.ie && v >= 5.5 && v     this.hasPngSupport = !hs.ie || (hs.ie && v >= 8);     this.hasOutline = this.outlineType && (this.hasAlphaImageLoader || this.hasPngSupport);

    this.outer = hs.createElement(
        'table',
        {    
           cellSpacing: 0 // saf
        },     {
            가시성: '숨김 ',
            위치: '절대',
            zIndex: hs.zIndexCounter ,
           borderCollapse: 'collapse'
        }, 컨테이너
    );
    this.tbody = hs.createElement('tbody', null, null, this.outer);

    this.preloadOutlineElement(1); // 재귀
};

HsOutline.prototype.preloadOutlineElement = function (i) {    
    if (this.outline[i] && this.outline[i].onload) { // Gecko 여러 온로드 버그
        이. 개요[i].onload = null;
        반품;
    }

    this.offset = this.hasOutline ? 10 : 0;
    if (i == 1 || i == 4 || i == 6) this.tr = hs.createElement('tr', null, null, this.tbody);
    if (i == 5) this.inner = hs.createElement('td', null, { padding: 0, margin: 0, border: 0, position: 'relative' }, this.tr);

    var files = 배열(0,8,1,2,7,3,6,5,4);
    var src = hs.graphicsDir   "outlines/"  this.outlineType  "/"  files[i]  ".png";

    if (this.hasAlphaImageLoader) {
        var bgKey = 'filter';
        var bgValue = "progid:DXImageTransform.Microsoft.AlphaImageLoader("
                     "enabled=true, sizingMethod=scale src='"  src   "') ";
    } else if (this.hasPngSupport || this.hasIe7Bug) {        
        var bgKey = '배경';
        var bgValue = 'url('  src  ')';
    }
    var styles = { lineHeight: 0, fontSize: 0, padding: 0, margin: 0, border: 0 };
    if (this.hasOutline) styles[bgKey] = bgValue;

    var td = hs.createElement('td', null, styles);

    var img = hs.createElement('img', null, { visibility: 'hidden', display: 'block' }, td); // onload 트리거

    var dim = 2 * this.offset;
    hs.setStyles (td, { 높이: dim  'px', 너비: dim  'px'} );

    var pThis = this;
    if (i     else img.onload = function() { 
        hs.pendingOutlines[pThis.outlineType] = pThis;
        if (pThis.onLoad) pThis.onLoad(); 
    };

    this.tr.appendChild(td);
    if (this.hasOutline) img.src = src;
    else img.onload();
};

HsOutline.prototype.destroy = function() {
    this.outer.parentNode.removeChild(this.outer);
};

//-------------------------------------------- ----------------------
// 확장 개체
HsExpander = 함수( a, params, contentType) {
    hs.continuePreloading = false;

    // 인라인 매개변수 재정의
    for (i = 0; i         var name = hs.overrides[i];
        if (params && typeof params[이름] != '정의되지 않음') this[이름] = params[이름];
        else this[이름] = hs[이름];
    }

    if (params && params.thumbnailId) {
        var el = hs.$(params.thumbnailId);

    } else { // 앵커 내의 첫 번째 img
        for (i = 0; i            if (a.childNodes[i].tagName && a .childNodes[i].tagName == 'IMG') {
                var el = a.childNodes[i];
                휴식;
           }            
        }
    }
    if (!el) el = a;

    
    // 기타 취소
    for (i = 0; i         if (hs.expanders[i]&& hs.expanders[i ].thumb != el && !hs.expanders[i].onLoadStarted) {
            hs.expanders[i].cancelLoading();
        }
    }
    // 이미 열려 있는지 확인하세요
    for (i = 0; i         if (hs.expanders[i] && hs.expanders[i].thumb = = el) {
           hs.expanders[i].focus();
            false를 반환합니다.
        } 

        else if (hs.expanders[i] && !hs.allowMultipleInstances) {
            hs.expanders[i].doClose();
        }

    }

    this.key = hs.expandedImagesCounter ;
    hs.expanders[this.key] = 이;
    if (contentType == 'html') {
        this.isHtml = true;
        this.contentType = 'html';
    } else {
        this.isImage = true;
        this.contentType = '이미지';
    }

    this.a = a;

    this.thumbsUserSetId = el.id || 지원;
    this.thumb = el;        

    this.overlays = new Array();

    var pos = hs.position(el); 

    // 래퍼 인스턴스화
    this.wrapper = hs.createElement(
       'div',
       {
           id: 'highslide-wrapper-'  this.key, 🎜 >           className: this.wrapperClassName
        },
        {
            가시성: '숨김',
            위치:         }
    );

    // 썸네일의 속성 저장
    this.thumbWidth = el.width ? el.width : el.offsetWidth;        
    this.thumbHeight = el.height ? el.height: el.offsetHeight;
    this.thumbLeft = pos.x;
    this.thumbTop = pos.y;
    this.thumbClass = el.className;

    // 엄지 테두리
    this.thumbOffsetBorderW = (this.thumb.offsetWidth - this.thumbWidth) / 2;
    this.thumbOffsetBorderH = (this.thumb.offsetHeight - this.thumbHeight) / 2;

        // 래퍼 가져오기
    if (hs.pendingOutlines[this.outlineType]) {
        this.connectOutline();
        this[this.contentType  '만들기']();
    } else if (!this.outlineType) {
        hs.genContainer();
        this[this.contentType  '만들기']();
    } else {
        this.displayLoading();
        var pThis = this;             } 
        );
    }

};

HsExpander.prototype.connectOutline = function(x, y) {    
    var w = hs.pendingOutlines[this.outlineType];
    this.objOutline = w;
    hs.pendingOutlines[this.outlineType] = null;
};

HsExpander.prototype.displayLoading = function() {
    if (this.onLoadStarted || this.loading) return;

    this.originalCursor = this.a.style.cursor;
    this.a.style.cursor = '기다려';

    if (!hs.loading) {
        hs.loading = hs.createElement('a',
           {
              className: 'highslide-loading',
                제목: hs .loadingTitle,
               innerHTML: hs.loadingText
             {
               위치:
            }, hs.container
        );
        if (hs.ie) hs.loading.style.filter = 'alpha(opacity='  (100*hs.loadingOpacity)  ')';
        else hs.loading.style.opacity = hs.loadingOpacity;
    }

    this.loading = hs.loading;
    this.loading.href = 'javascript:hs.expanders['  this.key  '].cancelLoading()';
    this.loading.visibility = '표시';        

    this.loading.style.left = (this.thumbLeft   this.thumbOffsetBorderW 
          (this.thumbWidth - this.loading.offsetWidth) / 2)  'px';
    this.loading.style.top = (this.thumbTop 
          (this.thumbHeight - this.loading.offsetHeight) / 2)  'px';
    setTimeout(
        "if (hs.expanders["  this.key  "] && hs.expanders["  this.key  "].loading) "
          "hs.expanders["  this.key  "] .loading.style.visibility = 'visible';", 
        100
    );
};

HsExpander.prototype.imageCreate = function() {
    var img = document.createElement('img');
    var key = this.key;

    var img = document.createElement('img');
    this.content = img;
    img.onload = function () { if (hs.expanders[key]) hs.expanders[key].onLoad();  };
    img.className = 'highslide-image'  this.thumbClass;
    img.style.visibility = '숨김'; // IE
에서 깜박임을 방지합니다.
    img.style.display = 'block';
    img.style.position = '절대';
    img.style.zIndex = 3;
    img.title = hs.restoreTitle;
    img.onmouseover = function () { 
        if (hs.expanders[key]) hs.expanders[key].onMouseOver(); 
    };
    img.onmouseout = 기능 (e) { 
        var rel = e ? e.관련Target : event.toElement;
        if (hs.expanders[key]) hs.expanders[key].onMouseOut(rel);
    };
    if (hs.safari) hs.container.appendChild(img);
    img.src = hs.getSrc(this.a);

    this.displayLoading();
};

HsExpander.prototype.onLoad = function() {    
    시도해 보세요 { 

        if (!this.content) return;
        if (this.onLoadStarted) 반환; // 오래된 Gecko 루프
        else this.onLoadStarted = true;

              
        if (this.loading) {
           this.loading.style.visibility = '숨김';
            this.loading = null;
            this.a.style.cursor = this.originalCursor || '';
        }

        if (this.isImage) {            
           this.newWidth = this.content.width;
            this.newHeight = this.content.height;
            this.fullExpandWidth = this.newWidth;
            this.fullExpandHeight = this.newHeight;

            this.content.width = this.thumbWidth;
            this.content.height = this.thumbHeight;         }

        //캡션 div 식별
        var modMarginBottom = hs.marginBottom;
        if (!this.captionId && this.thumbsUserSetId)  this.captionId = 'caption-for-'  this.thumbsUserSetId;
        if (this.captionId && (hs.$(this.captionId) || hs.$(this.captionId  '-taken'))) {
            this.origCaption = hs.$(this.captionId  ' -촬영') ? hs.$(this.captionId  '-taken') : hs.$(this.captionId);
            this.caption = this.origCaption.cloneNode(1);
            modMarginBottom  = this.spaceForCaption;
            if (!hs.$(this.captionId  '-taken')) this.origCaption.id = this.captionId  '-taken';
            if (!hs.$(this.captionId)) this.caption.id = this.captionId;
            else this.caption.id = null;
            if (this.captionTemplateId && hs.$(this.captionTemplateId)) {
              this.origCapTpl = hs.$(this.captionTemplateId);
                this.capTpl = this.origCapTpl.cloneNode(1);
               this.capTpl.innerHTML 
                  = this.capTpl.innerHTML.replace(/s/g, ' ').replace('{caption}', this.caption.innerHTML);
                this.caption = this.capTpl;

            }
        }

        this.wrapper.appendChild(this.content);
        this.content.style.position = '상대적'; // 안녕하세요
        if (this.caption) this.wrapper.appendChild(this.caption);
        this.wrapper.style.left = this.thumbLeft  'px';
        this.wrapper.style.top = this.thumbTop  'px';
        hs.container.appendChild(this.wrapper);

        // 테두리에 적합
        this.offsetBorderW = (this.content.offsetWidth - this.thumbWidth) / 2;
        this.offsetBorderH = (this.content.offsetHeight - this.thumbHeight) / 2;
        var modMarginRight = hs.marginRight   2 * this.offsetBorderW;
        modMarginBottom  = 2 * this.offsetBorderH;

        var ratio = this.newWidth / this.newHeight;
        var minWidth = this.allowSizeReduction ? this.minWidth : this.newWidth;
        var minHeight = this.allowSizeReduction ? this.minHeight : this.newHeight;

        var 정렬 = { x: 'auto', y: 'auto' };
        if (this.align == 'center') {
            justify.x = 'center';
            justify.y = '중앙';
        } else {
            if (this.anchor.match(/^top/)) justify.y = null;
            if (this.anchor.match(/right$/)) justify.x = 'max';
            if (this.anchor.match(/^bottom/)) justify.y = 'max';
            if (this.anchor.match(/left$/)) justify.x = null;
        }

        클라이언트 = new hs.clientInfo();        

        // 정당화
        this.x = { 
            min: parseInt(this.thumbLeft) - this.offsetBorderW   this.thumbOffsetBorderW, 범위: this.newWidth,
            minSpan: this.newWidth             justify: justify.x,              marginMin: hs.marginLeft, 
          marginMax:
            sc, 롤: client.scrollLeft,
            clientSpan: client.width,
            thumbSpan: this.thumbWidth
        };
        var oldRight = this.x.min   parseInt(this.thumbWidth);
        this.x = this.justify(this.x);

        this.y = { 
            min: parseInt(this.thumbTop) - this.offsetBorderH   this.thumbOffsetBorderH,
            span:
            minSpan: this.newHeight             justify: justify.y,              marginMin: hs.marginTop, 
           marginMax: modMarginBottom,            스크롤 : client.scrollTop,
            clientSpan: client.height,
            thumbSpan: this.thumbHeight
        };
        var oldBottom = this.y.min   parseInt(this.thumbHeight);
        this.y = this.justify(this.y);

        if (this.isHtml) this.htmlSizeOperations();    
        if (this.isImage) this.correntRatio(ratio);

        var x = this.x;
        var y = this.y;    

        // 선택 상자 버그
        var imgPos = {x: x.min - 20, y: y.min - 20, w: x.span   40, h: y.span   40   this.spaceForCaption};
        hs.hideSelects = (hs.ie && hs.ieVersion()         if (hs.hideSelects) this.showHideElements('SELECT', 'hidden', imgPos);
        // Iframes 버그
        hs.hideIframes = (window.opera || navigator.vendor == 'KDE' || (hs.ie && hs.ieVersion()         if (hs.hideIframes) this.showHideElements('IFRAME', 'hidden', imgPos);

        // 개요를 준비하세요    
        if (this.objOutline && !this.outlineWhileAnimating) this.positionOutline(x.min, y.min, x.span, y.span);
        var o2 = this.objOutline ? this.objOutline.offset : 0;

        // 크기 변경 적용        
        this.changeSize(
           1,
          this.thumbLeft   this.thumbOffsetBorderW - this.offsetB orderW,
            this.thumbTop   this.thumbOffsetBorderH - this.offsetBorderH ,
            this.thumbWidth,
            this.thumbHeight,
           x.min,
            y.min,

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

JS 및 Baidu Maps를 사용하여 지도 이동 기능을 구현하는 방법 JS 및 Baidu Maps를 사용하여 지도 이동 기능을 구현하는 방법 Nov 21, 2023 am 10:00 AM

JS 및 Baidu Map을 사용하여 지도 팬 기능을 구현하는 방법 Baidu Map은 지리 정보, 위치 지정 및 기타 기능을 표시하기 위해 웹 개발에 자주 사용되는 널리 사용되는 지도 서비스 플랫폼입니다. 이 글에서는 JS와 Baidu Map API를 사용하여 지도 이동 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 1. 준비 바이두 맵 API를 사용하기 전에 먼저 바이두 맵 오픈 플랫폼(http://lbsyun.baidu.com/)에서 개발자 계정을 신청하고 애플리케이션을 만들어야 합니다. 생성 완료

권장 사항: 우수한 JS 오픈 소스 얼굴 감지 및 인식 프로젝트 권장 사항: 우수한 JS 오픈 소스 얼굴 감지 및 인식 프로젝트 Apr 03, 2024 am 11:55 AM

얼굴 검출 및 인식 기술은 이미 상대적으로 성숙하고 널리 사용되는 기술입니다. 현재 가장 널리 사용되는 인터넷 응용 언어는 JS입니다. 웹 프런트엔드에서 얼굴 감지 및 인식을 구현하는 것은 백엔드 얼굴 인식에 비해 장점과 단점이 있습니다. 장점에는 네트워크 상호 작용 및 실시간 인식이 줄어 사용자 대기 시간이 크게 단축되고 사용자 경험이 향상된다는 단점이 있습니다. 모델 크기에 따라 제한되고 정확도도 제한됩니다. js를 사용하여 웹에서 얼굴 인식을 구현하는 방법은 무엇입니까? 웹에서 얼굴 인식을 구현하려면 JavaScript, HTML, CSS, WebRTC 등 관련 프로그래밍 언어 및 기술에 익숙해야 합니다. 동시에 관련 컴퓨터 비전 및 인공지능 기술도 마스터해야 합니다. 웹 측면의 디자인으로 인해 주목할 가치가 있습니다.

PHP와 JS를 사용하여 주식 촛대 차트를 만드는 방법 PHP와 JS를 사용하여 주식 촛대 차트를 만드는 방법 Dec 17, 2023 am 08:08 AM

PHP와 JS를 사용하여 주식 캔들 차트를 만드는 방법 주식 캔들 차트는 주식 시장에서 흔히 사용되는 기술 분석 그래픽으로 시가, 종가, 최고가 등의 데이터를 그려서 투자자가 주식을 보다 직관적으로 이해할 수 있도록 도와줍니다. 주식의 최저 가격. 이 기사에서는 특정 코드 예제와 함께 PHP 및 JS를 사용하여 주식 캔들 차트를 만드는 방법을 설명합니다. 1. 준비 시작하기 전에 다음 환경을 준비해야 합니다. 1. PHP를 실행하는 서버 2. HTML5 및 Canvas를 지원하는 브라우저 3

주식 분석을 위한 필수 도구: PHP 및 JS를 사용하여 캔들 차트를 그리는 단계를 알아보세요. 주식 분석을 위한 필수 도구: PHP 및 JS를 사용하여 캔들 차트를 그리는 단계를 알아보세요. Dec 17, 2023 pm 06:55 PM

주식 분석을 위한 필수 도구: PHP 및 JS에서 캔들 차트를 그리는 단계를 배우십시오. 인터넷과 기술의 급속한 발전으로 주식 거래는 많은 투자자에게 중요한 방법 중 하나가 되었습니다. 주식분석은 투자자의 의사결정에 있어 중요한 부분이며 캔들차트는 기술적 분석에 널리 사용됩니다. PHP와 JS를 사용하여 캔들 차트를 그리는 방법을 배우면 투자자가 더 나은 결정을 내리는 데 도움이 되는 보다 직관적인 정보를 얻을 수 있습니다. 캔들스틱 차트는 주가를 캔들스틱 형태로 표시하는 기술 차트입니다. 주가를 보여주네요

JS와 Baidu Map을 활용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 JS와 Baidu Map을 활용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 Nov 21, 2023 am 11:11 AM

JS 및 Baidu Maps를 사용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 개요: 웹 개발에서는 지리적 위치 및 지리적 정보를 표시하기 위해 지도 기능을 사용해야 하는 경우가 많습니다. 지도에서의 클릭 이벤트 처리는 지도 기능에서 일반적으로 사용되는 중요한 부분입니다. 이 글에서는 JS와 Baidu Map API를 사용하여 지도의 클릭 이벤트 처리 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 단계: Baidu Map API 파일 가져오기 먼저 다음 코드를 통해 Baidu Map API 파일을 가져올 수 있습니다.

JS 및 Baidu Maps를 사용하여 지도 히트맵 기능을 구현하는 방법 JS 및 Baidu Maps를 사용하여 지도 히트맵 기능을 구현하는 방법 Nov 21, 2023 am 09:33 AM

JS 및 Baidu Maps를 사용하여 지도 열 지도 기능을 구현하는 방법 소개: 인터넷과 모바일 장치의 급속한 발전으로 지도는 일반적인 응용 시나리오가 되었습니다. 시각적 표시 방법인 히트맵은 데이터 분포를 보다 직관적으로 이해하는 데 도움이 될 수 있습니다. 이 기사에서는 JS 및 Baidu Map API를 사용하여 지도 히트맵 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 준비 작업: 시작하기 전에 Baidu 개발자 계정, 애플리케이션 생성, 해당 AP 획득 등의 항목을 준비해야 합니다.

PHP 및 JS 개발 팁: 주식 캔들 차트 그리기 방법 익히기 PHP 및 JS 개발 팁: 주식 캔들 차트 그리기 방법 익히기 Dec 18, 2023 pm 03:39 PM

인터넷 금융의 급속한 발전으로 인해 주식 투자는 점점 더 많은 사람들의 선택이 되었습니다. 주식 거래에서 캔들 차트는 주가의 변화 추세를 보여주고 투자자가 보다 정확한 결정을 내리는 데 도움이 되는 일반적으로 사용되는 기술적 분석 방법입니다. 이 기사에서는 PHP와 JS의 개발 기술을 소개하고 독자가 주식 캔들 차트를 그리는 방법을 이해하도록 유도하며 구체적인 코드 예제를 제공합니다. 1. 주식 캔들 차트의 이해 주식 캔들 차트를 그리는 방법을 소개하기 전에 먼저 캔들 차트가 무엇인지부터 이해해야 합니다. 캔들스틱 차트는 일본인이 개발했습니다.

JS 및 Baidu Maps를 사용하여 지도 다각형 그리기 기능을 구현하는 방법 JS 및 Baidu Maps를 사용하여 지도 다각형 그리기 기능을 구현하는 방법 Nov 21, 2023 am 10:53 AM

JS 및 Baidu Maps를 사용하여 지도 다각형 그리기 기능을 구현하는 방법 현대 웹 개발에서 지도 애플리케이션은 일반적인 기능 중 하나가 되었습니다. 지도에 다각형을 그리면 사용자가 보고 분석할 특정 영역을 표시하는 데 도움이 될 수 있습니다. 이 기사에서는 JS 및 Baidu Map API를 사용하여 지도 다각형 그리기 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 먼저 Baidu Map API를 도입해야 합니다. 다음 코드를 사용하여 Baidu Map API의 JavaScript를 HTML 파일로 가져올 수 있습니다.

See all articles