Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rotating images with javascript

Status
Not open for further replies.

krone

Programmer
May 19, 2000
5
GB
hi<br>my first post to this forum<br><br>can anyone tell me if it's possible to rotate images using javascript (ie by 45 degrees not swapping images)<br><br>I know you can do this in VBScript but I want to find a way in javascript<br><br>tia<br><br>krone
 
Dear krone,<br><br>I bet if you show me the code to do this in VBScript I can tell you how to use Javascript.<br><br>-pete
 
hmmm I'll be very suprised if you can do this in a similar way in javascript but go for it - vb script follows (pinched from <A HREF=" TARGET="_new"> Sets initial variables and letter starting positions<br><br>Sub Window_OnLoad()<br> call SG1.Scale(0.50, 0.50, 0.50)<br> call SG1.Rotate(0, 0, 0)<br><br> RotateAll<br>end sub<br><br>' sets rotation speed and behavior as well as creating loop<br>'The three numbers below control the rotation in the three axis<br>'the first # is the rotation around a horizontal axis<br>'the second # is around a vertical axis<br>'the third # is rotation clockwise<br>Sub RotateAll<br> Call SG1.Rotate(0,0,-10)<br> FILK = Window.SetTimeOut(&quot;Call RotateAll&quot;, 10, &quot;VBSCript&quot;)<br>End Sub<br>--&gt;<br> <p> <br><a href=mailto: > </a><br><a href= > </a><br>Purveyor of quality HTML, CSS, Javascript, TCL, SQL, ASP, VB, and am developing a palate for Java.<br>
 
Dear Krone,<br><br>I have no idea from your post what 'SG1' is but this would be the javascript syntax equiv to your VBScript:<br><br>&lt;script language=javascript&gt;<br>&lt;!--<br>//Sets initial variables and letter starting positions<br><br>function window_onload(){<br><br>SG1.Scale(0.50, 0.50, 0.50);<br>SG1.Rotate(0, 0, 0);<br><br>RotateAll();<br>} // window_onload()<br><br>function RotateAll(){<br>&nbsp;&nbsp;SG1.Rotate(0,0,-10);<br>&nbsp;&nbsp;FILK = window.setTimeout(&quot;RotateAll&quot;, 10);<br>} // RotateAll()<br>--&gt;<br>&lt;/script&gt;<br><br>&lt;body onload=&quot;window_onload()&quot;&gt;<br>....<br><br>&lt;/body&gt;<br><br>Hope this helps<br>-pete
 
SG1 is the id of the object to be rotated - sorry!<br><br>but the problem is, AFAIK there is no rotate option in javascript - if I'm wrong please let me know!!<br><br>also there is no scale option as far as i know...<br><br>thanks for your help <br><br>andy <br><br> <p> <br><a href=mailto: > </a><br><a href= > </a><br>Purveyor of quality HTML, CSS, Javascript, TCL, SQL, ASP, VB, and am developing a palate for Java.<br>

 
Dear krone,<br><br>I just looked in the VBScript language reference and there is no 'Rotate' Method or function there either. <br><br>Do you know what object type you are refering to as SG1? Or do you know what entity you are using that supports the 'Rotate' method?<br><br>-pete<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top