Results 1 to 1 of 1
Thread: DHTML Fading Animation Image
-
05-15-2010, 11:03 AM #1
Junior
- Join Date
- Jul 2009
- Posts
- 193
- Thanks
- 0
- Thanked 5 Times in 5 Posts
- Feedback Score
- 0
DHTML Fading Animation Image
Enhancing image presentation on your website with this image rotator plus smooth dynamic motion (fade-in-fade-out). A very great anima... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place JavaScript below in your HEAD section
JavaScript
Step 2: Copy & Paste HTML code below in your BODY sectionCode:<SCRIPT language=javaScript> <!-- Beginning of JavaScript - sandra0 = new Image(); sandra0.src = "photo1.jpg"; sandra1 = new Image(); sandra1.src = "photo2.jpg"; sandra2 = new Image(); sandra2.src = "photo3.jpg"; var i_strngth=1 var i_image=0 var imageurl = new Array() imageurl[0] ="photo1.jpg" imageurl[1] ="photo2.jpg" imageurl[2] ="photo3.jpg" function showimage() { if(document.all) { if (i_strngth <=110) { testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>"; i_strngth=i_strngth+10 var timer=setTimeout("showimage()",100) } else { clearTimeout(timer) var timer=setTimeout("hideimage()",1000) } } if(document.layers) { clearTimeout(timer) document.testimage.document.write("<img src="+imageurl[i_image]+" border=0>") document.close() i_image++ if (i_image >= imageurl.length) {i_image=0} var timer=setTimeout("showimage()",2000) } } function hideimage() { if (i_strngth >=-10) { testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>"; i_strngth=i_strngth-10 var timer=setTimeout("hideimage()",100) } else { clearTimeout(timer) i_image++ if (i_image >= imageurl.length) {i_image=0} i_strngth=1 var timer=setTimeout("showimage()",500) } } // - End of JavaScript - --> </SCRIPT>
HTML
Code:<BODY onload=showimage()> <DIV id=mainbod style="POSITION: relative; VISIBILITY: visible"></DIV> <DIV id=testimage style="POSITION: relative; VISIBILITY: visible"></DIV> </BODY>
Similar Threads
-
Create High Quality Thumbnail - Resize Image Dynamically - ASP .Net C# Code
By manik in forum ASPReplies: 18Last Post: 03-03-2012, 11:39 PM -
Image Effects
By yawez.com in forum HTML / DHTMLReplies: 43Last Post: 12-04-2011, 11:41 AM -
Google image swirl
By mamedesign in forum GoogleReplies: 0Last Post: 02-22-2010, 09:52 PM -
Fading Slide Show
By JavaScriptBank in forum JavaScript & AJAXReplies: 2Last Post: 12-31-2009, 09:15 AM -
Image Link in Google Image
By BrainPulse in forum GoogleReplies: 4Last Post: 05-03-2009, 04:08 AM



Reply With Quote

