Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Dynamic Images

  1. #1
    New Coder
    Join Date
    Jun 2004
    Location
    Coventry, UK
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Dynamic Images

    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.

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by lordofthesword8
    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.
    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:

    Code:
    <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

  • #3
    New Coder
    Join Date
    Jun 2004
    Location
    Coventry, UK
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks for it and sorry

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •