html to make images different fade in and out

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2009
Posts: 2
Reputation: postal07 is an unknown quantity at this point 
Solved Threads: 0
postal07 postal07 is offline Offline
Newbie Poster

html to make images different fade in and out

 
0
  #1
Jul 2nd, 2009
I have been trying this also and can,t get it to work thought i had the right code.Please help
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 13
Reputation: Bojero is an unknown quantity at this point 
Solved Threads: 3
Bojero Bojero is offline Offline
Newbie Poster

Re: html to make images different fade in and out

 
0
  #2
Jul 3rd, 2009
If you want fading effects for various elements on an html page then the jQuery javascript library is for you. The following example fades out and then fades back in all divs on a page that are clicked.

  1. <html>
  2. <head>
  3. <script type="text/javascript" src="jquery.js"></script>
  4. <script type="text/javascript">
  5. $(function(){
  6. $("div").click(function() {
  7. $("div").fadeOut("slow", function() {
  8. $("div").fadeIn("slow");
  9. });
  10. });
  11. });
  12. </script>
  13. </head>
  14.  
  15. <body>
  16. <div style="width: 400px; height: 400px; background: #CC0000; border: #000000"></div>
  17. </body>
  18. </html>

Here's the javascript bit on it's own:

  1. $(function(){
  2. $("div").click(function() {
  3. $("div").fadeOut("slow", function() {
  4. $("div").fadeIn("slow");
  5. });
  6. });
  7. });
Last edited by Bojero; Jul 3rd, 2009 at 4:25 am.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 10
Reputation: MattTheHat is an unknown quantity at this point 
Solved Threads: 0
MattTheHat MattTheHat is offline Offline
Newbie Poster

Re: html to make images different fade in and out

 
0
  #3
Jul 3rd, 2009
Of course it would help to know more precisely what your doing but in lieu of that there are some CSS3 things that will help specifically the new 'opacity' property.

However you will need to create several versions (one for each browser) because CSS3 is not properly out yet.
A cascading try/catch system should do the trick.

Or you could just use Jquery (I like to code everything myself then I know where I am with it).
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: rangminank is an unknown quantity at this point 
Solved Threads: 0
rangminank rangminank is offline Offline
Newbie Poster

Re: html to make images different fade in and out

 
0
  #4
Jul 3rd, 2009
Thanks for u info...
i think i can use it for my picture somedays....


<FAKE SIGNATURE>
Last edited by peter_budo; Jul 4th, 2009 at 6:07 am. Reason: Keep It On The Site - Do not manually post "fake" signatures in your posts. Instead, you may create a sitewide signature within the user control panel.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 17
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster

Re: html to make images different fade in and out

 
0
  #5
Jul 4th, 2009
Actually, look at the innerfade library for jQuery for out-of the box functionality...
http://medienfreunde.com/lab/innerfade/

Cheering You Up!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC