rss search

next page next page close

JQuery OnSelect Display Image

finding is over a jQuery plugin which will allow me to display an image preview from a select list of images – onfocus/onchange..

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>JQuery OnSelect Display Image</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
 $(document).ready(function() {
   $("#myImage").change(function() {
     $("#imagePreview").empty();
     if ( $("#myImage").val()!="" ){
        $("#imagePreview").append("<img src=\"" + $("#image").val()  + "\" />");
     }
     else{
        $("#imagePreview").append("displays image here");
     }
   });
 });
</script>
</head>
<body>
<select name="myImage" id="myImage" class="inputbox" size="1">
   <option value=""> - Select Image - </option>
   <option value="image1.jpg">image1.jpg</option>
   <option value="image2.jpg">image2.jpg</option>
   <option value="image3.jpg">image3.jpg</option>
</select>

<div id="imagePreview">
   displays image here
</div>

</body>
</html>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

JQuery OnSelect Display Image

Share|finding is over a jQuery plugin which will allow me to display an image preview...
article post

Devguru.in is Stephen Fry proof thanks to caching by WP Super Cache