jQuery onchange / onfocus选择框来显示图像?

我需要一些帮助才能找到一个jQuery插件,它允许我从选择的图像列表中显示图像预览 – onfocus / onchange ..

例:

  - Select Image -  image1.jpg image2.jpg image3.jpg  
displays image here

有没有人遇到这样的事情? 我试过寻找它无济于事..

谢谢!

我不确定你需要一个插件来处理这个问题:

 $(document).ready(function() { $("#image").change(function() { var src = $(this).val(); $("#imagePreview").html(src ? "" : ""); }); }); 

我不认为有这个插件,但“手工”做起来相当简单

 $(document).ready(function(){ $('#image').change(function(){ $('#imagePreview').html(''); }); }); 

您应该为不存在的图像添加validation等。 你的旅费可能会改变。 等等

你真的需要一个插件吗?

像下面这样的简单工作吗?

    JQuery Image      
displays image here

使用AJAX的替代方法。 我还没有测试过,但是用Google搜索了这个主题。 以下是一些注意事项:

http://forums.asp.net/t/1107236.aspx

服务器端

 response.contentType('image/jpeg'); response.binaryWrite(imageBytes); 

显示来自Respose.WriteFile()/ Response.ContentType的广告内容

http://www.dotnetperls.com/response-writefile

 Response.WriteFile usage: 10.680 s Byte[] cache, Response.BinaryWrite: 0.094 s 

我在这里分享纯javascript版本使用下拉列表更改图像: –