2017-05-17 11 views
0

클릭하면 대상 객체를 제거하는 qtip 툴팁 안에 버튼이 있습니다. 그러나 대상 객체 (캘린더 이벤트)를 제거한 후에 툴팁은 계속 볼 수 있습니다. 툴팁을 제거/숨기는 방법? 다음은 qtip 옵션과 스크린 샷입니다.qtip 내부 버튼을 클릭하여 툴팁 숨기기

var content = '<button class="btn btn-xs btn-default delCalendarEvent" id="' + event._id + '"><i class="fa fa-trash"></i></button>'; element.qtip({ show: { event: 'click', solo: true }, hide: { event: 'click unfocus' }, content: content, style: { classes: 'qtip-bootstrap' }, position: { my: 'bottom center', at: 'top center', container: $('.fc') } }); enter image description here

enter image description here

답변

1

당신은 다음과 같이 함수에서 생성되는 컨텐츠를 갖는 장난 시도 할 수 있습니다 :

$('a[title]').qtip({show: { 
     event: 'click', 
     solo: true 
    }, 
    hide: { 
     event: 'click unfocus' 
    }, 
    content: function() { 
     var context = this.context; 
     var btn = $('<button class="btn btn-xs btn-default delCalendarEvent" id="55">X</button>'); 
     btn.click(function() { 
     $(context).qtip().destroy(); 
     $(context).remove(); 
     }) 
     return btn; 
    }, 
    style: { 
     classes: 'qtip-bootstrap' 
    }, 
    position: { 
     my: 'bottom center', 
     at: 'top center', 
     container: $('.fc') 
    } 
    }); 

JSFiddle : http://jsfiddle.net/tnmj7w1p/

+0

당신에게 사람을 감사 ! 그것은 작동합니다. – andrey

+0

당신을 진심으로 환영합니다. 도와 줄 수있어서 기뻐! –