...

View Full Version : Dynamic Images



lordofthesword8
06-29-2004, 03:09 PM
Hello!!

With dynamic images, is it possible using JavaScriptto create a new image, position it using pixels, then delete it after around 10 seconds? If you could give some examples it be really gratefull. :confused: :thumbsup:

Willy Duitt
06-29-2004, 09:33 PM
Hello!!

With dynamic images, is it possible using JavaScriptto create a new image, position it using pixels, then delete it after around 10 seconds? If you could give some examples it be really gratefull. :confused: :thumbsup:

I dislike answering such general questions. You do not say what you would like to use to create or pick the image to create. You do not say exactly where you would like the image to appear. The only clear thing within your entire post is to have the image disappear in 10 seconds.

Anyway, play with this:


<BASE HREF="http://www.andrewgray.com/">
<script type="text/javascript">
<!--//
function createImage(option){
newImage = document.createElement('img');
newImage.src = option.value;
newImage.style.zIndex = 1;
newImage.style.position = 'absolute';
newImage.style.bottom = 10;
newImage.style.right = 10;
document.body.appendChild(newImage);
setTimeout('document.body.removeChild(newImage)',10000);
}
//-->
</script>
</HEAD>

<BODY>
<P>Create an image:</p>
<form>
<select onchange="createImage(this)">
<option>Choose A Picture</opton>
<option value="monkey.gif">Monkey</option>
<option value="monkey.gif">Monkey</option>
</select>
</form>

.....Willy

lordofthesword8
07-05-2004, 03:06 PM
Thanks for this code, im gonna have a crack at it, and sorry about such a general question but I just wondered if it was at all possible before I started planning a script.

LOTS8 :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum