2014-02-21 2 views
0

나는 하이 슬라이드 팝업을 사용합니다. 안정된 위치 팝업을 원합니다. 하이 슬라 이드 고정 위치 팝업

내가 시도 : 나는 텍스트가 짧은 경우, 팝업이 무작위로 튀어 ... 많은 텍스트가있을 때

hs.marginTop="120"; 

의미가 있습니다.

    hs.graphicsDir = "./includes/highslide/graphics/"; 
        hs.outlineType = "rounded-white"; 
        hs.wrapperClassName = "draggable-header"; 
        hs.marginTop="120"; 

     $(function() { 
         var dialog=$(".siteText").html(); 
         $("#highslide-html .highslide-body").html(dialog); 

         if(!$(".highslide-body").is(":empty")) 
         { 
          hs.htmlExpand(this, { contentId: \'highslide-html\' }) 
         } 

        }); 

HTML :

 <div class="highslide-html-content" id="highslide-html" style="width:950px;color:black;"> 

        <div class="highslide-header"> 
          <ul> 
            <li class="highslide-close"> 
              <a href="#" title="Close (esc)" onclick="return hs.close(this)"><span>Close</span></a> 
            </li> 
          </ul> 
        </div> 
        <div class="highslide-body"> 
        </div> 
       <div class="highslide-footer"> 
        <div> 
         <span class="highslide-resize" title="Resize"> 
          <span></span> 
         </span> 
        </div> 
       </div> 
      </div> 

편집 : 의미가 있습니다 ...하지만 매우 추한 효과 ... 팝업 점프 일반적으로 오른쪽 하단

내 코드에서. 첫 번째는 맨 아래에 있고, 맨 위로 이동합니다.

if (!hs.ie || hs.uaVersion > 6) hs.extend (hs.Expander.prototype, { 
fix: function(on) { 
    var sign = on ? -1 : 1, 
     stl = this.wrapper.style; 

    if (!on) hs.getPageSize(); // recalculate scroll positions 


    hs.setStyles (this.wrapper, { 
     position: "fixed", 
     zoom: 1, // IE7 hasLayout bug, 
     left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +"px", 
     top: "125px" 
    }); 

    if (this.outline) { 
     stl = this.outline.table.style; 
     hs.setStyles (this.outline.table, { 
      position: "fixed", 
      zoom: 1, // IE7 hasLayout bug, 
      left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +"px", 
      top: "120px" 
     }); 

    } 
    this.fixed = on; // flag for use on dragging 
}, 
onAfterExpand: function() { 
    this.fix(true); // fix the popup to viewport coordinates 
}, 

onBeforeClose: function() { 
    this.fix(false); // unfix to get the animation right 
}, 

onDrop: function() { 
    this.fix(true); // fix it again after dragging 
}, 

onDrag: function(sender, args) { 
    if (this.fixed) { // only unfix it on the first drag event 
     this.fix(true); 
    } 
}}); 

THX :) hs.marginTop를 사용

답변

0

작동하지 않을 수 있습니다. 당신이 쫓고있는 것은 hs.targetX와 hs.targetY입니다. 이것들은 당신이 고정 된 위치에 팝업의 위치를 ​​정하게합니다. API : http://highslide.com/ref/hs.targetX을 참조하십시오. ID가있는 대상 "div"에 대한 요구 사항에주의하십시오. 이는 빈 자리 표시 자일 수도 있지만 존재해야합니다.

0

그냥 당신이 사용하고 삭제하는 당신의 highslide의 CSS에서

.highslide-container 
{ 
    position:fixed; top:200px; left:-380px 
    } 

을 추가

position: 'absolute', 
       left: 0, 
       top: 0, 

만이 주어진 위치부터 사용하고있는 highslide 스크립트에서

className: 'highslide-container' 
      }, { 
       position: 'absolute', 
       left: 0, 
       top: 0, 
       width: '100%', 
       zIndex: hs.zIndexCounter, 
       direction: 'ltr' 
      }, 
      document.body,