jQuery从输入文本框显示图像预览

时间:2014-11-30 21:13:06

标签: jquery html css twitter-bootstrap-3

我需要使用带有type="text"的输入框值使用bootstrap popover显示图像预览,如下所示:

enter image description here

HTML:

 <input type="text" class="form-control" value="https://secure.gravatar.com/avatar/b64518ca2a465c3ef67299a39758c383?s=100&r=g&d=mm">

如何在输入悬停中显示预览?!

1 个答案:

答案 0 :(得分:0)

您可以使用以下示例代码:

$(function () {
    $("#example")
        .popover({ title: 'Twitter Bootstrap Popover', content: "It's so simple to create a tooltop for my website!" })
        .blur(function () {
            $(this).popover('hide');
        });
});