javascript - Display actual Image from Switch Function instead of URL text -
I am working on a script and in addition to this, I have to do the job that I You can see it. In addition, I would like to display a background image default image ... Once again when you select the input, the image on the background image changes. Here is part of a script that generates a URL Here is the Change your code as follows: In addition, div div ID) to show a real image and not only the URL of the image.
$ ('# show_image_text') HTML (image_name). // Put $ url URL ('# show_image'). Html (image_name); // Enter the image value in the Formula Image field src});
div where I want to display the image. Style requirement for
width ,
height , and
background-image
$ (' #show_image '). CSS ('background-image', 'url' ('+ +' + image_name + '') ");
#show_image There is no height set, so the image will not appear until you set it to its height explicitly
#show_image {height: 50px; width: 200px; background -image: url ('path on default image'); // You can set a default image like this, which will override after the image is set in the code ...} < p> updated
Comments
Post a Comment