473,412 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Image rotation

1
I'm wanting to rotate an image, can someone tell me whats wrong with this script? Thanks.
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. <!--
  3. var birth=new array();
  4. for(i=0 ;i<=2;i=i+1)
  5. birth=[i]=new Image();
  6. }
  7. birth[0].mce_src="http://sba-nl-sm6-03.medseek.com/websitefiles/jordanhealthsys68254/images//birth2.jpg";
  8. birth[1].mce_src="http://sba-nl-sm6-03.medseek.com/websitefiles/jordanhealthsys68254/images//birth3.jpg";
  9. var current;
  10. current=Math.round(2*Math.random()-.5);
  11. function rotate(){
  12.  
  13. if(current<2){
  14. current=current+1;
  15. }
  16. else{
  17. current=0;
  18. }
  19. document.images[0].src=birth[current].src
  20. }
  21. function getfirst(){
  22. document.images[0].src=birth[current].src;
  23. setInterval("rotate()",2000);
  24. }
  25. //--></script>
May 3 '07 #1
3 1523
r035198x
13,262 8TB
I'm wanting to rotate an image, can someone tell me whats wrong with this script? Thanks.

<script language="JavaScript">
<!--
var birth=new array();
for(i=0 ;i<=2;i=i+1)
birth=[i]=new Image();
}
birth[0].mce_src="http://sba-nl-sm6-03.medseek.com/websitefiles/jordanhealthsys68254/images//birth2.jpg";
birth[1].mce_src="http://sba-nl-sm6-03.medseek.com/websitefiles/jordanhealthsys68254/images//birth3.jpg";
var current;
current=Math.round(2*Math.random()-.5);
function rotate(){

if(current<2){
current=current+1;
}
else{
current=0;
}
document.images[0].src=birth[current].src
}
function getfirst(){
document.images[0].src=birth[current].src;
setInterval("rotate()",2000);
}
//--></script>
Moved to Javascript forum
May 3 '07 #2
acoder
16,027 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. birth=[i]=
should be
Expand|Select|Wrap|Line Numbers
  1. birth[i]=
"array" should be "Array".

What goes wrong with the script? Does it not work at all? What is it supposed to do - keep swapping images every 2 seconds?
May 4 '07 #3
dmjpro
2,476 2GB
having the proper sytax try to use try/catch block in JS.

then have the familiarity with JS errors geneally occures.

Regards.
May 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Deepa | last post by:
Hi All, I'm facing problem displaying image of size 5000X5000 .My window size is smaller than image size so i'm not able to see the complete image.i can use scroll bars to view the image but i...
2
by: Andreas Viklund via DotNetMonster.com | last post by:
Hi! I am developing an application in ASP.NET that takes an image, that have been created with a digital camera or camera phone, and processes it, to get data from it. The image taken by the user...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
3
by: Mark Szlazak | last post by:
The following page simulates a pool cue and cue ball: http://members.aol.com/myscript/cue.html Mouse cursor position around the cue ball determines where a roll-over of 179 pool cue images is...
5
by: Russell Warren | last post by:
Does anyone have an easier/faster/better way of popping from the middle of a deque than this? class mydeque(deque): def popmiddle(self, pos): self.rotate(-pos) ret = self.popleft()...
5
by: Ricardo Furtado | last post by:
I'm trying, for a week or two, to create a procedure in order to rotate the image in any picturebox control in a cephalometry software. I've found a web site that shows how that can be done:...
9
by: Ohann | last post by:
Hi I have a page with 9 images on, each one placed within a table cell. I want to be able to have a different image displayed each time the page is refreshed as well as being able to have the...
3
by: kimiraikkonen | last post by:
Hi, Here is a very interesting issue, Assume i have picturebox and loaded a image into picturebox, however whenever i want to rotate image using: 'For example 90 degree...
8
by: infoseekar | last post by:
Image Resize & Rotation Hi I have 2 scripts, one for Image rotation and other image resize and they both are working. Image resize scripts load the picture and resize it and Image rotation...
3
by: chvennela | last post by:
Hi, how to make complete rotation any image in html/css <img src=C:\Users\Desktop\DSC00583.JPG" height=300 widht=200 style="image-rotation:90deg;">
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.