This is a discussion on Fading Images within the Website Design Articles forums, part of the Webmaster Articles/Tutorials category; Originally Posted by Zaltan PHP is a pre-processing language, so when someone tries to access a PHP page, the PHP ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| | #21 (permalink) | |
| WMT Addict | Quote:
| |
| | |
| | #22 (permalink) | |
| Newbie | Quote:
put your javascript...on includes/javascript.php add this line before ?> echo "<SCRIPT language=JavaScript>\n"; echo "<!--\n\n"; echo "nereidFadeObjects = new Object();\n"; echo "nereidFadeTimers = new Object();\n"; echo "function nereidFade(object, destOp, rate, delta){\n"; echo "if (!document.all)\n"; echo "return\n"; echo "if (object != \"[object]\"){ \n"; echo "setTimeout(\"nereidFade(\"+object+\",\"+destOp+\" ,\"+rate+\",\"+delta+\")\",0);\n"; echo "return;\n"; echo "}\n"; echo "clearTimeout(nereidFadeTimers[object.sourceIndex]);\n"; echo "diff = destOp-object.filters.alpha.opacity;\n"; echo "direction = 1;\n"; echo "if (object.filters.alpha.opacity > destOp){\n"; echo "direction = -1;\n"; echo "}\n"; echo "delta=Math.min(direction*diff,delta);\n"; echo "object.filters.alpha.opacity+=direction*delta;\n" ; echo "if (object.filters.alpha.opacity != destOp){\n"; echo "nereidFadeObjects[object.sourceIndex]=object;\n"; echo "nereidFadeTimers[object.sourceIndex]=setTimeout(\"nereidFade(nereidFadeObjects[\"+object.sourceIndex+\"],\"+destOp+\",\"+rate+\",\"+delta+\")\",rate);\n "; echo "}\n"; echo "}\n"; echo "//-->\n"; echo "</SCRIPT>\n"; then find n add this line to you images directory on your theme file.... <img src=\"/your pic.gif\" width=\"100\" border=\"0\" style=filter:alpha(opacity=100) onMouseOut=nereidFade(this,100,20,10) onMouseOver=nereidFade(this,20,5,5)> sorry my english so poor.. Last edited by phroz3n; 03-08-2005 at 09:55. | |
| | |
| | #24 (permalink) |
| Senior Member | Why are you having it echo every line?! Thats way more work than it needs to be. You could do 1 of two things. Either just close the ?> php tag and what follows would just print to the page normaly and reopen the tag when theres more php. Or do 1 echo command with ' ' quotes instead of " ". |
| | |
| Tags |
| fading, images |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Fading colours??? | Lewis | Website Design Forum | 2 | 27-06-2005 05:26 |
| Fading Links | asgsoft | Website Design Articles | 5 | 14-06-2005 17:50 |
| Expanding Images | Aaron | Programming Articles | 0 | 23-04-2005 21:53 |
| HTML Images | Bmg | Programming Articles | 0 | 07-04-2005 16:24 |