SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fading to background

    Hey guys, I need to be able to click on an image and then when its selected/clicked, it kind of goes lighter. Maybe fade from a dull image to a lighter version. Is this easy enough to do in Javascript, if so any ideas where to start please

    Thanks in advance
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Addict Mirek Komárek's Avatar
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To make it well is not easy at all, one very good source is here http://www.brothercake.com/site/reso...s/transitions/

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it would help a bit if you explained WHY you have to do this. What is the image? I suspect that the answer is in CSS and not so much Javascript.

    Try applying the following CSS to the image:

    Code:
    opacity:0.5;
    filter: alpha(opacity=50);
    -moz-opacity: 0.5;
    And it will fade 50% into the background.

    You could create a onclick event on the image that sets this via JavaScript.

    Here is a good page about opacity: http://www.mandarindesign.com/opacity.html
    Soren Beck Jensen

    http://www.automaticbacklinks.com - Free link exchange network
    http://www.notwebdesign.com - Joomla web design in Spain

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure that that will not validate though, and if so thats not an option. Ill look into both though. The reason im doing this is that a client has requested a pic be clicked and it kind of fade into a darker shade or something like that. And im not prepared to use flash on it
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm reading through that, it seems he has quoted some text from w3c so maybe it will validate, that will do the trick nicely. ty
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  6. #6
    SitePoint Evangelist anjanesh's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai
    Posts
    447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another interesting script at DynamicDrive : FadeInSlideShow.
    Anjanesh


Bookmarks

Posting Permissions

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