Reputation: 5550
I have the following style for DIV:
#dropzone
{
height: 530px;
width: 530px;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: 2px dashed #0687FF;
display: block;
background-image: url(/Images/RE/02.png);
}
I'm implementing drag and drop function onto the web. And upon dropping the image, I get a whole chunk of strings like below:
I'm trying to change the background image of my dropzone
using
alert(evt.target.result);
//$('#dropzone').css('background-image', url(evt.target.result));
//$('#dropzone').css('background-image', evt.target.result);
Both of the commented way are not working. Please advice
Upvotes: 0
Views: 581
Reputation: 33
You should put a jpg image and see it will appear but there is a problem with png files try this
Upvotes: 0
Reputation: 123397
try using camelCase notation for the property and interpolate your variable, like so
$('#dropzone').css('backgroundImage', 'url(' + evt.target.result + ')');
Upvotes: 4