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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image Fade In/Out

    I want to make a image fade in on click of a link, for example like this:

    http://www.wakeupmrsingh.com/

    I found this script I could use:

    http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    Then I found this js script I could use to fade in the image, but I don't know how to put the codes together:

    http://clagnut.com/sandbox/imagefades/

    How can I put the codes togther, and make a image fade in/out on click? Am I using the wrong codes?

    HELP PLEASE!

  • #2
    Regular Coder Actinia's Avatar
    Join Date
    Feb 2007
    Location
    Essex, UK
    Posts
    250
    Thanks
    1
    Thanked 23 Times in 22 Posts
    The clagnut page uses the line
    Code:
    window.onload = function() {initImage()}
    so that the image begins to fade in as soon as your page is loaded. In your case, you would use the initImage() function as an event in your link code. Something like:
    Code:
    <a href="mylink" onclick="initImage();">Link text</a>
    John

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks alot for responding.

    One question though; How do I put the clagnut codes together as a script?

  • #4
    Regular Coder Actinia's Avatar
    Join Date
    Feb 2007
    Location
    Essex, UK
    Posts
    250
    Thanks
    1
    Thanked 23 Times in 22 Posts
    Try the code here. Does this do what you want?

    John

  • #5
    Regular Coder
    Join Date
    Jul 2006
    Posts
    399
    Thanks
    33
    Thanked 7 Times in 7 Posts
    how can you make the same thing as clagnut but with an array of 3 images?

  • #6
    Regular Coder Actinia's Avatar
    Join Date
    Feb 2007
    Location
    Essex, UK
    Posts
    250
    Thanks
    1
    Thanked 23 Times in 22 Posts
    Do you mean you want:

    an array of three images to be faded in together,

    or one at a time,

    or each image gets faded in when you click on an appropriate link,

    or a single image placeholder, with the selected image fading in?

    The first of these options would be more complex than the other three and would require re-writing the clagnut code.

    John


  •  

    Posting Permissions

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