我有自定义绑定工作,有点:
http://jsfiddle.net/PTSkR/115/
弹出框有效,但内容是链接,而不是图像本身。如何让图像显示在弹出窗口中?
代码:
ko.bindingHandlers.bootstrapPopover = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var options = valueAccessor();
var defaultOptions = {trigger: 'hover'};
options = $.extend(true, {}, defaultOptions, options);
$(element).popover(options);
}
};
var viewModel = {
sideOneTextContent: ko.observable('<img src="https://si0.twimg.com/a/1339639284/images/three_circles/twitter-bird-white-on-blue.png" />')
}
ko.applyBindings(viewModel);