2013-04-18 2 views
0

나는 사이드에 대한 QTip을 사용하고 있습니다 : 당신이 볼 수 있듯이 enter image description hereQtip을 페이지 경계에 보관 하시겠습니까?

,하여 QTip은 오프 스크린 약간가는 내 화면에 못생긴 hscrollbar을 만듭니다. 여기

코드입니다 : 이제

function appendCalendarEventToList(className, event) { 

    var eventObject = { 
     title: event.title, 
     id: event.id, 
     type: event.type, 
     color: event.color, 
     description: event.description, 
     canReoccur: event.canReoccur, 
     reoccurVal: event.reoccurVal, 
     estHours: event.estHours 
    }; 

    var div = document.createElement("div"); 
    div.className = 'external-event'; 
    div.style.background = event.color; 
    div.innerHTML = event.title; 

    // store the Event Object in the DOM element so we can get to it later 
    $(div).data('eventObject', eventObject); 

    $(div).draggable({ 
     helper: function() { 
      $copy = $(this).clone(); 
      $copy.data('eventObject', eventObject); 
      $copy.css({ "list-style": "none", "width": $(this).outerWidth() }); return $copy; 
     }, 
     appendTo: 'body', 
     zIndex: 999, 
     revert: true,  // will cause the event to go back to its 
     revertDuration: 0 // original position after the drag 
    }); 

    $(className).append(div); 

    $(div).qtip({ 
     content: event.title, 

     position: 
      { 
       target: 'mouse' 
      }, 
     // show: { event: 'click' }, 
     hide: { event: 'mousedown mouseleave' }, 
     style: { 
      width: 200, 
      padding: 5, 
      color: 'black', 
      textAlign: 'left', 
      border: { 
       width: 1, 
       radius: 3 
      }, 


      classes: { 
       tooltip: 'ui-widget', 
       tip: 'ui-widget', 
       title: 'ui-widget-header', 
       content: 'ui-widget-content' 
      } 
     } 
    }); 


    return div; 
} 

, 내가 무엇을 사랑하면 내가 (페이지 내에서 유지 수 있다면, 경우 (tip.right> page.right, tip.right = page.right)) 또는 뭔가 ..

이 방법이 있습니까?

최소한, 스크롤 막대가 발생하지 않도록하고 싶습니다.

감사

답변

0

내가 세 바보 답을 가지고 ...

  1. 사용 position:fixed 대신 qtip에 position:absolute.
  2. width 대신 max-width을 사용하고 right:0을 정의하면 qtip의 오른쪽이 본문의 맨 오른쪽을 결코 초과하지 않습니다.
  3. 시도해보십시오. tipy jQuery 툴팁 플러그인 제가 직접 만들었습니다 (이 경우에는 내 생각을 말해주십시오).
+0

그들은 바보가 아닙니다 ... 그들은 모두 훌륭한 답입니다! – jmasterx

관련 문제