这个插件是这样的,如果输入框中的地址是图片地址的话,只要双击鼠标便能够看到这张图片。
但是不清楚这个插件叫什么名字,所以请教下大家。
首先在该输入框中是一张图片的地址
如果双击以后,便会跳出这张图片

解决方案 »

  1.   

    没用过这个插件,刚写了个粗燥的,楼主可以 改改
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="gb2312" />
    <title></title>
    <style>
    * {
    margin:0; padding:0;
    font-size:12px;
    }
    input {
    display:block;
    width:500px;
    }
    img {display:block;}
    body {
    height:100%;
    }
    .w {
    display:none;
    position:absolute; left:0; top:0; z-index:999;
    width:100%; height:100%;
    background:#000;
    filter:alpha(opacity=40); opacity:.4;
    }
    </style>
    </head>
    <body>
    <input id="a" value="http://avatar.profile.csdn.net/A/3/8/2_zqz4987.jpg" />
    <div class="w" id="wrap"></div>
    <script>
    function $(el){
    return typeof el == 'string' ? document.getElementById(el) : el;
    }
    function $t(name, cot){
    cot = cot || document;
    return cot.getElementsByTagName(name);
    }
    var re = /^http.+jpg$/i;
    $('a').ondblclick = function(){
    if( re.test(this.value) ){
    $('wrap').style.display = 'block';
    var div = document.createElement('div');
    div.style.cssText = 'border:1px solid red; padding:1px; z-index:1000; position:absolute;'
    div.innerHTML = '<div style="border-bottom:1px solid red; padding-right:10px; background:#fff; line-height:22px; cursor:pointer; text-align:right;">关闭X</div><img src="'+this.value+'" />';
    document.body.appendChild(div);
    $t('div', div)[0].onclick = function(){
    $('wrap').style.display = 'none';
    document.body.removeChild(div);
    }
    }
    }
    </script>
    </body>
    </html>