【发布时间】:2013-11-29 10:14:08
【问题描述】:
我在我的自定义 jquery 代码中使用了 popover bootstrap,我想在 popover('disable') 之后激活它 [like .popover('enable')]
我的代码是这样的:
$('#edit-mode').on('click',function(){
$(this).toggleClass('edit-on');
if($(this).hasClass('edit-on')){
$(this).css('color','#d9534f');
//to disable link
$('.alink').click(function(){
return false;
});
//$('.alink').popover('enable');
//popover a link
$('.alink').popover({
animation: true,
html : true,
trigger: "click",
placement: 'top',
container: 'body',
stayOnHover: true,
selector: this,
delay: {show: 100,hide: 100},
content: function() {
return $('#popover_content_wrapper').html();
}
});
}
else{
$(this).css('color','#3276b1');
//to enable link
$('.alink').click(function(e){
window.location.href = $(this).attr('href');
});
$('.alink').popover('hide');
//disable popover
$('.alink').popover('disable');
}
});
【问题讨论】:
标签: twitter-bootstrap popover javascript