|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hm... I just get error messages... Just as a test:
Code:
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',50); void(0);
__________________
The best way to learn anything, is to question everything. Last edited by wige; 01-20-2009 at 11:16 AM. |
|
|||
|
Thanks, guys. Always fun to tinker around, and learn new things at the same time. Here's a boiled down version that works nicely as a drop-in effect on a page full of images, as suggested:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>javascript animation tip</title> </head> <body> <div> <ul> <li><a href="#" onclick="javascript:setInterval('A()',50); void(0);">Animation Effect</a></li> </ul> </div> <script type="text/javascript"><!-- R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){ for(i=0; i-DIL; i++){ DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"; } R++; } //--></script> </body> </html> Last edited by weegillis; 01-20-2009 at 10:37 PM. Reason: typos |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AJAX and javascript calling javascript | krnl | Web Programming Discussion Forum | 14 | 11-18-2007 11:00 AM |
| Javascript + RSS + RSS = ? | ofoglada | Web Programming Discussion Forum | 6 | 02-05-2006 06:33 AM |
| javascript | souvik das | Submit Your Logo For Review | 2 | 02-25-2005 11:40 AM |
| XP SP2, IE and Javascript | ChrisBowd | Graphics & Design Discussion Forum | 1 | 08-26-2004 08:23 AM |
| Javascript and php | icb01co2 | Web Programming Discussion Forum | 1 | 08-09-2004 11:25 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |