Let's look at the effect chart first:
The opportunity is rare, a bit of technology bright spot, suddenly put into function development to go. In this piece of function development, oneself still learn some good things, one of them is, the user chooses to upload the picture, how to preview it out. On the Internet to find some information, the final use of the following methods:
Copy Code code as follows:
function (obj) {//logo Upload Add Event
var logoimg = null;
if (document.all) {//If IE is the case
Obj.select ();
Logoimg = Document.selection.createRange (). text;
Because the filter is the way, so to set the picture is not visible, in the picture outside the Div set filter effect
$ (". Setup_logo_left img"). Removeattr ("src");
$ (". Setup_logo_left img"). CSS ("display", "none");
var img = document.getElementById ("Preview_fake");
Img.filters.item (
' DXImageTransform.Microsoft.AlphaImageLoader '). src = logoimg;
Return
}
Logoimg = Obj.files[0].getasdataurl ();
$ (". Setup_logo_left img"). attr ("src", logoimg);
}
The effect is very good, in the Ie6,ie7,ie8,fox, oh there is a special to the tangled 360 are normal display